ВУЗ: Не указан

Категория: Не указан

Дисциплина: Не указана

Добавлен: 13.06.2025

Просмотров: 4205

Скачиваний: 0

ВНИМАНИЕ! Если данный файл нарушает Ваши авторские права, то обязательно сообщите нам.

17 Real-Time Image Processing

0 0 0 0 0 0 0 0 0 0 0 1 0

0 0 0 0 0 0 0 0 0 0 1 1 1

0 0 0 0 0 0 0 0 0 0 1 1 0

0 0 0 0 0 0 0 0 0 0 0 1 0

0 2 0 0 0 0 0 0 0 0 0 0 0

2 2 2 0 0 0 0 0 0 0 0 2 2

2 2 2 2 2 0 2 0 0 2 2 2 2

2 2 2 2 2 2 2 2 2 2 2 2 2

Input image

Segmented image

Figure 17.10: Segmentation example

If, as for many applications, identifying rectangular areas is sufficient, then the task becomes relatively simple. For now, we assume there is at most a single coherent object of each color class present in the image. For more objects of the same color class, the algorithm has to be extended to check for coherence. In the simple case, we only need to identify four parameters for each color class, namely top left and bottom right corner, or in coordinates:

[xtl, ytl], [xbr, ybr]

Finding these coordinates for each color class still requires a loop over all pixels of the segmented image, comparing the indices of the current pixel position with the determined extreme (top/left, bottom/right) positions of the previously visited pixels of the same color class.

17.8 Image Coordinates versus World Coordinates

Image coordinates

World coordinates

Whenever an object is identified in an image, all we have is its image coordinates. Working with our standard 60u80 resolution, all we know is that our desired object is, say, at position [50, 20] (i.e. bottom left) and has a size of 5u7 pixels. Although this information might already be sufficient for some simple applications (we could already steer the robot in the direction of the object), for many applications we would like to know more precisely the object’s location in world coordinates relative from our robot in meters in the x- and y-direction (see Figure 17.11).

For now, we are only interested in the object’s position in the robot’s local coordinate system {x´, y´}, not in the global word coordinate system {x, y}. Once we have determined the coordinates of the object in the robot coordinate system and also know the robot’s (absolute) position and orientation, we can transform the object’s local coordinates to global world coordinates.

As a simplification, we are looking for objects with rotational symmetry, such as a ball or a can, because they look the same (or at least similar) from any viewing angle. The second simplification is that we assume that objects are not floating in space, but are resting on the ground, for example the table the robot is driving on. Figure 17.12 demonstrates this situation with a side

258


Image Coordinates versus World Coordinates

y

0 0

0

0

0

0

0

0

´

0 0

0

0

0

0

0

0

y

0 0

0

0

0

0

0

0

0 0

0

0

0

0

0

0

0 0

1

0

0

0

0

0

0 1

1

1

0

0

0

0

0 1

1

0

0

0

0

0

0 0

0

0

0

0

0

0

Robot image data

World view

Figure 17.11: Image and world coordinates

x

view and a top view from the robot’s local coordinate system. What we have to determine is the relationship between the ball position in local coordinates [x´, y´] and the ball position in image coordinates [j, i]:

y´ = f (i, h, D, f, d) x´ = g (j, 0, E, f, d)

i = y´ object size

camera angle D (about x)

in [pixels]

camera height h

ball size d

ball y´-position in [m]

camera angle E

ball x´-pos.

j = x´ object size

(about z)

in [m]

in [pixels]

camera focal length f

in [m]

Figure 17.12: Camera position and orientation

259


17 Real-Time Image Processing

It is obvious that f and g are the same function, taking as parameters:

One-dimensional distance in image coordinates (object’s length in image rows or columns in pixels)

Camera offset

(height in y´z´ view, 0 side offset in x´y´ view)

Camera rotation angle (tilt or pan)

Camera focal length

(distance between lens and sensor array)

Ball size (diameter d)

Provided that we know the detected object’s true physical size (for example golf ball for robot soccer), we can use the intercept theorem to calculate its local displacement. With a zero camera offset and a camera angle of zero (no tilting or panning), we have the proportionality relationships:

yc

d

xc

d

----

a --

----

a --

f

i

f

j

These can be simplified when introducing a camera-specific parameter g = k · f for converting between pixels and meters:

y´ = g · d / i x´ = g · d / j

So in other words, the larger the image size in pixels, the closer the object is. The transformation is just a constant linear factor; however, due to lens distortions and other sources of noise these ideal conditions will not be observed in an experiment. It is therefore better to provide a lookup table for doing the transformation, based on a series of distance measurements.

With the camera offset, either to the side or above the driving plane, or placed at an angle, either panning about the z-axis or tilting about the x-axis, the trigonometric formulas become somewhat more complex. This can be solved either by adding the required trigonometric functions to the formulas and calculating them for every image frame, or by providing separate lookup tables from all camera viewing angles used. In Section 18.5 this method is applied to robot soccer.

17.9 References

BÄSSMANN, H., BESSLICH, P. Ad Oculos: Digital Image Processing, International Thompson Publishing, Washington DC, 1995

BLAKE, A., YUILLE, A. (Eds.) Active Vision, MIT Press, Cambridge MA, 1992

260


References

BRÄUNL, T. Parallel Image Processing, Springer-Verlag, Berlin Heidelberg, 2001

BRÄUNL, T. Improv – Image Processing for Robot Vision, http://robotics. ee.uwa.edu.au/improv, 2006

CHO, H., LEE., J.-J. (Ed.) 2002 FIRA Robot World Congress, Proceedings, Korean Robot Soccer Association, Seoul, May 2002

FAUGERAS, O. Three-Dimensional Computer Vision, MIT Press, Cambridge MA, 1993

GONZALES, R., WOODS, R., Digital Image Processing, 2nd Ed., Prentice Hall, Upper Saddle River NJ, 2002

HEARN, D., BAKER, M. Computer Graphics - C Version, Prentice Hall, Upper Saddle River NJ, 1997

KAMINKA, G. LIMA, P., ROJAS, R. (Eds.) RoboCup 2002: Robot Soccer World Cup VI, Proccedings, Fukuoka, Japan, Springer-Verlag, Berlin Heidelberg, 2002

KLETTE, R., PELEG, S., SOMMER, G. (Eds.) Robot Vision, Proceedings of the International Workshop RobVis 2001, Auckland NZ, Lecture Notes in Computer Science, no. 1998, Springer-Verlag, Berlin Heidelberg, Feb. 2001

KORTENKAMP, D., NOURBAKHSH, I., HINKLE, D. The 1996 AAAI Mobile Robot

Competition and Exhibition, AI Magazine, vol. 18, no. 1, 1997, pp. 2532 (8)

LECLERCQ, P., BRÄUNL, T. A Color Segmentation Algorithm for Real-Time Object Localization on Small Embedded Systems, Robot Vision 2001, International Workshop, Auckland NZ, Lecture Notes in Computer Science, no. 1998, Springer-Verlag, Berlin Heidelberg, Feb. 2001, pp. 69-76 (8)

NALWA, V. A Guided Tour of Computer Vision, Addison-Wesley, Reading MA, 1993

PARKER, J. Algorithms for Image Processing and Computer Vision, John Wiley & Sons, New York NY, 1997

261