Project

General

Profile

Statistics
| Revision:

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

History | View | Annotate | Download (551 Bytes)

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

    
5
#include <vision.h>
6
#include <stdio.h>
7

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

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

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

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

    
24
  free(positions);
25

    
26
  vision_destroy();
27

    
28
  return 0;
29
}