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


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

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


desc
@Test file for the Sequential Component Labeling algorithm.
@


1.2
log
@Added standard header, changed exit to return.
Added write stmts so there would actually be output when executing the test.
@
text
@// test-scl.c           Section: 11.3, Sequential Component Labeling
//      Copyright 1994, Center for Computer Vision and Visualization,
//      University of Florida.  All rights reserved.

// Test program for the Sequential Component Labeling application.

#include "sequential-component-labeling.h"

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

    if ( argc == 1 ) {
	cerr << "Usage: " << endl
	     << "\t" << argv[0]
	     << "  4|8  < input.pgm > output.pgm"
	     << endl << endl
	     << "Cmd line arg == 4 => use 4-connected, "
	     << "otherwise use 8-connected"
	     << endl;
       return 1;
    }


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

    double connectivity( atoi( argv[1] ) );
    if (connectivity != 4) {
	cerr << "Using 8-connectivity to label connected components" << endl;

	sequential_component_labeling_8( image ).write_PGM( cout );

    } else {
	cerr << "Using 4-connectivity to label connected componets" << endl;

	sequential_component_labeling_4( image ).write_PGM( cout );
    }

    return 0;
}
@


1.1
log
@Initial revision
@
text
@d1 1
a1 1
// test-scl.c           Section: 11.3
d9 1
a9 1
void main( int argc, char * argv[] ) {
d19 1
a19 1
       exit( 1 );
d29 1
a29 1
	sequential_component_labeling_8( image );
d34 1
a34 1
	sequential_component_labeling_4( image );
d37 1
a37 1
    exit( 0 );
@
