ADT compiles and runs.

Following code produces sane output:

using namespace CVD;
using namespace std;

int main()
{

	Image<byte> in(ImageRef(50,50));

	Image<Rgb<byte> > o(in.size());

	o.zero();

	in.zero();

	for(int i=1; i < 8; i++)
		in[rand() % 50][rand()%50] = i;

	Image<float> out(in.size());
	Image<ImageRef> adt(in.size());

	euclidean_distance_transform(in, out, adt);

	for(ImageRef p(-1,0); p.next(in.size()); )
	{
		cout << adt[p] << flush;
		int n = in[adt[p]];

		int r = n&1;
		int g = (n&2)/2;
		int b = (n&4)/4;

		o[p].red = 255*r;
		o[p].green = 255*g;
		o[p].blue = 255*b;

	}

	img_save(in, "in.png");

	for(ImageRef p(-1,0); p.next(in.size()); )
		in[p] = min(255.f, out[p]);

	img_save(o, "adt.png");
	img_save(out, "result.tif");
}