Using PCA

(Michael's section)

Monte Carlo Localization

[Dellaert] describes an algorithm to localize a robot using a sampled probability distribution. The input information needed can be derived from different sensors, like laser range finders and cameras. In [Dellaert (2)] experimental results for a camera mounted on top of a robot facing the ceiling are described. The information used is the average over a few pixels in the center of the image weighted by a Gaussian, which corresponds to the brightness of the ceiling directly above the robot. A map of ceiling brightness is created offline and later used to localize the robot in real time.

The location of the robot is described by a sampled probability distribution. It is updated by odometry information when the robot moves. Uncertainty of measurements is considered, resulting in a less clustered distribution. Then a new measurement of the brightness of the ceiling is taken and used to update the distribution again, this time resulting in a more clustered distribution.
Sampled probability distribution (black dots) over brightness map of first floor ceiling of the Museum for American History, Washington [Dellaert (2)]. Relatively uniform distribution, robot not localized.
After a few steps: The samples build clusters.
After some more steps: The probability distribution is reduced to one single cloud, the robot is localized (with some uncertainty).

Approach

Instead of using only a small part of the image, more information should be included. The question is which information is most useful to descriminate between images taken at different locations. Principal Component Analysis (PCA) allows to find a projection matrix to determine the most discriminating features of the images.

Samples from different location of the environment with different rotation angles are taken. Each n-by-m pixels image is converted to an n*m vector. All the images are combined to a matrix M whose eigenvectors with the highest corresponding eigenvalues are the most discriminating features. In order to calculate these eigenvalues and eigenvectors, the covariance matrix of M is needed. But since M has dimension n*m (in our case in the order of 225000 without using color) this cannot be done in the conventional way. Instead a trick from [Turk] is used, which first calculated the covariance of the transpose of M, then its eigenvectors and -values, and out of that finally the eigenvectors and -values of the matrix M itself.

Implementation

We took sample images at known locations covering all 3rd floor hallways of the MaRC building, resulting in about 380 images with an average distance of 1m. The hallway is H-shaped with side lengths of about 85 and 36 meters. The location of each image has to be known approximately, but it should be mentioned that offline algorithms exist which are capable of creating such maps automatically without knowledge of the position of the robot; these algorithms are computationally very expensive, and the implementation was outside of the scope of this project.

Analysis of the images obtained from the omnicam showed that they are stretched in x-direction by a factor of 1.11 and have to be corrected accordingly. Furthermore, the black disc in the middle, where the camera sees itself, is not in the center of the image of the environment. The correct location of this center is the intersection of images of lines that are vertical in the environment, like doorframes and windows. Since the camera is off-center, the images are additionally distorted, but the effect is minimal and should not have a big influence on the experiments. After finding the correct center, the image was cropped to be square-shaped, and a mask was constructed to hide the black disc in the center and the black regions outside of the image. That way rotation of the image gives (approximately) the same result as rotating the camera in the environment. To restrict the complexity of the following computations, the images are converted to gray scale. The possible advantages of including color information has to be examined in later work. As mentioned above, eigenvectors were calculated using the trick from [Turk]. Since these eigenvectors can be reshaped to the size of the original images and displayed as gray scale images after scaling, they are also called eigenimages. Here are the mean and some eigenimages calculated out of 10 sample images. Each of these images was rotated to 32 different angles (11.25 degree resolution):
Mean from 320 images (10 locations, 32 rotation angles).


First 5 eigenimages from 320 images.
Using these eigenimages as a projection matrix, all the sample images can be projected and the results put into a map of the environment. Empty spaces between the samples are filled by interpolation.

In order to get a complete map, all the images have to be combined resulting in a matrix using more then 20GB of memory. This of course cannot be done at once, but the calculation has to be split into small pieces. Since this was outside the scope of our project, we created a map for only one corridor (32m by 1.7m), assuming a fixed orientation of the robot.

Map of one corridor (32m by 1.7m) calculated from 58 sample images with fixed orientation. Each sample is projected using the first three eigenimages. The resulting three values are assigned to the colors red, green and blue. Points between the samples are obtained by interpolation.

This map can now be used to localize the robot. At run-time, the robot takes an omnicam image from its current position, projects the image to an l-dimensional vector using P, and calculates the sum of square differences for each point of the map to generate an energy function. This energy function is related to the probability function of the location of the robot according to the sensor measurement and serves as input to the Monte Carlo Localization algorithm.

Energy function using one of the sample images. The brightest point at the top, near the center, is the actual location the image was taken from.

This part will be continued next semester as a CS8903 with Frank Dellaert to solve the problems described, and to combine with already existing Monte Carlo Localization code.


Back to main page
Last modified: Thu Dec 6 10:00:34 EST 2001