Master Thesis - Fachbereich Informatik
Master Thesis - Fachbereich Informatik
Master Thesis - Fachbereich Informatik
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
90 CHAPTER 4. LENGTH MEASUREMENT APPROACH<br />
length [pixel]<br />
418<br />
417.5<br />
417<br />
416.5<br />
416<br />
415.5<br />
Measurements<br />
Polynomial Fit<br />
415<br />
0 50 100 150 200<br />
x<br />
250 300 350 400<br />
(a)<br />
Correction [pixel]<br />
1.4<br />
1.2<br />
1<br />
0.8<br />
0.6<br />
0.4<br />
0.2<br />
Perspective Correction Function<br />
0<br />
0 50 100 150 200<br />
x<br />
250 300 350 400<br />
(b)<br />
Length [pixel]<br />
418<br />
417.5<br />
417<br />
416.5<br />
416<br />
415.5<br />
Corrected Measurements<br />
Mean<br />
415<br />
0 50 100 150 200<br />
x<br />
250 300 350 400<br />
Figure 4.25: Perspective correction. (a) The measured length varies depending on the<br />
image position in terms of the left measuring point. Due to perspective the length of one tube<br />
appears larger at the image center than at the image boundaries. The effect of perspective<br />
can be approximated by a 2nd order polynomial. (b) The correction function computed from<br />
the polynomial coefficients. (c) The result of the perspective correction.<br />
4.6.1. Distance Measure<br />
The distance between the two measuring points pL and pR (see Section 4.2) is computed<br />
over the Euclidean distance. Thus, the pixel length l ofatubeisdefinedasfollows:<br />
l = � (pR − pL) 2 (4.19)<br />
where l is expressed in terms of pixels. In the following, l(x) denotes the pixel length of<br />
a tube at position x where x = xpL , i.e. the position of a measurement is defined by the<br />
x-coordinate of the left measuring point.<br />
4.6.2. Perspective Correction<br />
Figure 4.25(a) shows the measured pixel length l(x) of a metal reference tube (gage) at<br />
different image positions. The sequence was acquired at the slowest conveyor velocity.<br />
In the ideal case l should be equal independent of the measuring position. However, the<br />
measured length is smaller at the boundaries and maximal at the image center due to<br />
perspective. This property is consistent between tubes. To approximate the ideal case, a<br />
perspective correction can be applied to the real measurements. Mathematically this can<br />
be expressed as:<br />
lcor(x) =l(x)+fcor(x) (4.20)<br />
where lcor is the perspective corrected pixel length, and fcor a correction function. The<br />
perspective variation in the measurements can be approximated by a 2nd order polynomial<br />
of the form:<br />
f(x) =c1x 2 + c2x + c3<br />
(c)<br />
(4.21)<br />
where the coefficients of the polynomial ci have to be determined in the teach-in step<br />
by fitting the function f(x) to measured length values l(x) in least-squares sense. Then,<br />
the correction function fcor canbecomputedas: