root / trunk / code / projects / colonet / vision / vision_driver.c @ 435
History | View | Annotate | Download (571 Bytes)
1 |
/**
|
---|---|
2 |
* Driver for testing vision library.
|
3 |
*/
|
4 |
|
5 |
#include <vision.h> |
6 |
#include <stdio.h> |
7 |
#include <stdlib.h> |
8 |
|
9 |
int main(int argc, char** argv) { |
10 |
const char* filename = (argc == 2) ? argv[1] : (char*)"colonet.jpg"; |
11 |
|
12 |
if (vision_init(filename) != 0) { |
13 |
fprintf(stderr, "init_vision failed.\n");
|
14 |
return -1; |
15 |
} |
16 |
|
17 |
VisionPosition* positions; |
18 |
int num_positions = vision_get_robot_positions(&positions);
|
19 |
|
20 |
int i;
|
21 |
for (i = 0; i < num_positions; i++) { |
22 |
printf("%d,%d\n", positions[i].x, positions[i].y);
|
23 |
} |
24 |
|
25 |
free(positions); |
26 |
|
27 |
vision_destroy(); |
28 |
|
29 |
return 0; |
30 |
} |