Project

General

Profile

Statistics
| Revision:

root / trunk / code / projects / colonet / vision / vision_driver.c @ 431

History | View | Annotate | Download (532 Bytes)

1
/**
2
 * Driver for testing vision library.
3
 */
4

    
5
#include <vision.h>
6

    
7
int main(int argc, char** argv) {
8
  const char* filename = (argc == 2) ? argv[1] : (char*)"colonet.jpg";
9

    
10
  if (init_vision(filename) != 0) {
11
    fprintf(stderr, "init_vision failed.\n");
12
    return -1;
13
  }
14

    
15
  VisionPosition* positions;
16
  int num_positions = vision_get_robot_positions(&positions);
17

    
18
  int i;
19
  for (i = 0; i < num_positions; i++) {
20
    printf("%d,%d\n", positions[i].x, positions[i].y);
21
  }
22

    
23
  free(positions);
24

    
25
  vision_destroy();
26

    
27
  return 0;
28
}