summaryrefslogtreecommitdiff
path: root/2003/i/buzz/src/vision/test_image.cc
blob: 006c764f4adc3f499b4ccefcfffd5717e7c021df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// test_image.cc - Teste la classe Image.
// buzz - Programme du robot Efrei Robotique I1-I2 2003
// Copyright (C) 2003 Nicolas Schodet
#include "image.h"

extern "C" {
#include <ppm.h>
};

int
main (int argc, char **argv)
{
    Image *i;
    Thresholds *t;
    ppm_init (&argc, argv);
    try
      {
	t = new Thresholds ("rc/vision/palets.rgb");
	i = new Image (argc == 2 ? argv[1] : "test.ppm", t);
	i->filter ();
	i->group ();
	i->groupFilter ();
	i->dumpGroups ();
	i->dump ("dump.ppm");
	delete i;
	delete t;
      }
    catch (const char *s)
      {
	fprintf (stderr, "test_image: %s\n", s);
	return 1;
      }
    return 0;
}