14.11.2012 Views

Submitted version of the thesis - Airlab, the Artificial Intelligence ...

Submitted version of the thesis - Airlab, the Artificial Intelligence ...

Submitted version of the thesis - Airlab, the Artificial Intelligence ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

5.3. Tracking 65<br />

any color values. It means, if <strong>the</strong> object is exposed to light, <strong>the</strong> parts that<br />

are exposed to light are not considered as white but a tone <strong>of</strong> target color,<br />

similarly with <strong>the</strong> previous configuration <strong>the</strong> dark pixel such as <strong>the</strong> parts in<br />

<strong>the</strong> shadow are considered as black, but with <strong>the</strong> new configuration <strong>the</strong>y are<br />

also considered as a tone <strong>of</strong> <strong>the</strong> target color.<br />

Second step is calculation <strong>of</strong> <strong>the</strong> color information in a better way. Previously,<br />

we calculated <strong>the</strong> information by ST color picker s<strong>of</strong>tware. With<br />

this s<strong>of</strong>tware we select <strong>the</strong> color region we want to assume as <strong>the</strong> blob color.<br />

The problem <strong>of</strong> this approach is that <strong>the</strong> blob may not consists <strong>of</strong> a single<br />

rule (RGB color code). Some parts <strong>of</strong> <strong>the</strong> object are darker, some parts<br />

are lighter. Also with <strong>the</strong> distance, <strong>the</strong> color that is composing <strong>the</strong> object<br />

is changing. Additionally, <strong>the</strong> colors that are not considered as red, blue,<br />

green, represented again as rules (RGB color codes) and it is not possible to<br />

understand by just looking at <strong>the</strong> color code whe<strong>the</strong>r it is <strong>the</strong> correct color<br />

coding or not. These makes it very difficult to determine <strong>the</strong> color with <strong>the</strong><br />

ST color picker s<strong>of</strong>tware. Instead, we decided to find <strong>the</strong> color histogram<br />

that is <strong>the</strong> distribution <strong>of</strong> <strong>the</strong> selected color properly in <strong>the</strong> RGB channels<br />

separately. To do so, we took several samples from <strong>the</strong> camera, in different<br />

distances, in different illuminations to find a proper average. The calculated<br />

results are later tested with <strong>the</strong> ST color picker s<strong>of</strong>tware, since it <strong>of</strong>fers a<br />

good interface to see whe<strong>the</strong>r <strong>the</strong> color is selected correct or not, in a visual<br />

way.<br />

The third step is related to <strong>the</strong> estimation <strong>of</strong> <strong>the</strong> objects distance to <strong>the</strong><br />

robot. As mentioned before, <strong>the</strong> diameter <strong>of</strong> <strong>the</strong> ball is a problematic issue<br />

due to <strong>the</strong> low-cost optics, hence we decided to use an object with cylindric<br />

shape, and <strong>the</strong> second configuration for <strong>the</strong> transformation. This distance<br />

is easier to measure, independently from <strong>the</strong> shape <strong>of</strong> <strong>the</strong> object, and will<br />

always change as <strong>the</strong> object’s position changes in <strong>the</strong> world.<br />

During <strong>the</strong> implementation to <strong>the</strong> microcontroller to increase <strong>the</strong> performance,<br />

we tried to avoid matrix and floating point operations. The matrices<br />

that can be defined statically are defined statically. To avoid floating point<br />

operations, <strong>the</strong> floating points are converted into integer, <strong>the</strong>n multiplied by<br />

a constant (most <strong>of</strong> <strong>the</strong> times 1000). The operations are made in integer,<br />

and <strong>the</strong> result is returned as floating point by dividing with <strong>the</strong> constant.<br />

We ensure that <strong>the</strong> microcontroller will not spend too much time in matrix<br />

and floating point operations, using this approach.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!