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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

120 Appendix B. Documentation <strong>of</strong> <strong>the</strong> programming<br />

#define MOTOR3_DIRECTION_B GPIO_Pin_7<br />

//bumper pins<br />

#define BUMPER1 GPIO5<br />

#define BUMPER2 GPIO0<br />

#define BUMPER3 GPIO4<br />

#define BUMPER_FRONT_LEFT GPIO_Pin_2 //5.2<br />

#define BUMPER_FRONT_RIGHT GPIO_Pin_0 //4.0<br />

#define BUMPER_BACK_LEFT GPIO_Pin_7 //1.7<br />

#define BUMPER_BACK_RIGHT GPIO_Pin_1 //4.1<br />

#define BUMPER_RIGHT GPIO_Pin_3 //5.5<br />

#define BUMPER_LEFT GPIO_Pin_0 //1.0<br />

#define LEFT 1<br />

#define RIGHT 0<br />

#define CLOSE 8<br />

#define NORMAL 4<br />

#define FAR 2<br />

#endif<br />

/******************* (C) COPYRIGHT 2007 STMicroelectronics *****END OF FILE****/<br />

B.2 Color Histogram Calculator<br />

————–color calculator.m——————<br />

%% data structure to keep images<br />

R = [];<br />

G = [];<br />

B = [];<br />

%% <strong>the</strong> sample images should be read 1−by−1<br />

im = imread( ’table3 .png ’ );<br />

fprintf( ’done \t ’ );<br />

%% <strong>the</strong> part containing <strong>the</strong> object should be selected<br />

[sub] = imcrop(im(: ,: ,1:3));<br />

imshow(sub);<br />

subR = double(sub (: ,: ,1));<br />

subG = double(sub (: ,: ,2));<br />

subB = double(sub (: ,: ,3));

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

Saved successfully!

Ooh no, something went wrong!