head	1.2;
access;
symbols;
locks; strict;
comment	@// @;


1.2
date	94.10.14.06.16.22;	author rjj;	state Exp;
branches;
next	1.1;

1.1
date	94.08.09.03.07.12;	author rjj;	state Exp;
branches;
next	;


desc
@Initial implementation of the Medial Axis Transform.
Note the the inverse is not yet implemented.
@


1.2
log
@Added algorithm name to header.  Made spelling and style changes.
Added support for the inverse_medial_axis() function.
@
text
@// test-mat.c           Section: 4.4  Medial Axis Transform (MAT)
//      Copyright 1994, Center for Computer Vision and Visualization,
//      University of Florida.  All rights reserved.
// Test the Medial Axis Transform


#include "mat.h"
#include "shaped-pointset.h"


int  main(int argc, char *argv[]) {

    // If a value was passed on the command line, use that as the
    //    radius of the digital disc, otherwise default to 1
    double argvalue = ( argc > 1 ? atof(argv[1]) : 0.0);
    double radius   = (argvalue != 0.0 ? argvalue : 1.0);
    cerr << "Using radius = " << radius << endl;

    IA_Image<IA_Point<int>,IA_Bit>  a = read_PBM(cin);

    IA_Set<IA_Point<int> >
	ball = digital_disc( IA_Point<int>(0,0), radius );

    cerr <<  "Calculating Medial Axis Transform...";
    unsigned int iCount = 0;
    IA_Image<IA_Point<int>,int>  m = medial_axis( a, ball, iCount );
    m.write_PGM( cout );
    cerr << "iCount: " << iCount << endl;

    cerr << "Calculating the inverse transform...";
    write_PBM( inverse_medial_axis( m, ball ), "inverse-mat.pbm" );
    cerr << "wrote file 'inverse-mat.pbm'." << endl;

    return 0;
}
@


1.1
log
@Initial revision
@
text
@d1 1
a1 1
// test-mat.c           Section: 4.4
d11 1
a11 1
void main(int argc, char *argv[]) {
d15 2
a16 2
    double argvalue( argc > 1 ? atof(argv[1]) : 0.0);
    double radius(argvalue != 0.0 ? argvalue : 1.0);
d19 1
a19 2
    IA_Image<IA_Point<int>,IA_Bit>
	a( IA_Image<IA_Point<int>,IA_Bit>::read_PBM(cin) );
d21 4
d26 3
a28 5
    IA_Image<IA_Point<int>,int>
	m( medial_axis( a,
			digital_disc( IA_Point<int>(0,0), radius ),
			iCount )
	   );
d30 3
a32 1
    cerr << "iCount: " << iCount << endl;
d34 1
a34 1
    m.write_PGM( cout );
@
