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


1.3
date	94.10.13.06.04.28;	author rjj;	state Exp;
branches;
next	1.2;

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

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


desc
@Initial version of the Max-Min Sharpening algorithm.
@


1.3
log
@Added algorithm name to header, spelling changes.
@
text
@// test-max-min.c    Section: 2.6  Max-min Sharpening Transform
//      Copyright 1994, Center for Computer Vision and Visualization,
//      University of Florida.  All rights reserved.
// Max-min sharpening transform test code
//
// This program takes upto three command line arguments:
//      1st arg: # of iterations of the max_min_sharpening() algorithm
//      2nd arg: radius of shaped-pointset to use (default == 1)
//      3rd arg: if 1 then use digital_disc(), cross_hair() otherwise


#include "Image.h"
#include "max-min.h"
#include "shaped-pointset.h"

int main(int argc, char *argv[]) {
    
    // if a value was passed on the command line, use that as the
    //   number of iterations, otherwise default to 1 iteration.
    //   => 1 trip through the max-min sharpening algorithm.

    // Iteration count ?
    int argvalue = ( argc > 1 ? atoi(argv[1]) : 1);
    unsigned int iterationCount = (argvalue > 1 ? argvalue : 1);
    cerr << "Using iteration count = " << iterationCount << endl;

    // Radius value ?
    argvalue = ( argc > 2 ? atoi(argv[2]) : 1);
    unsigned int  radius = (argvalue > 1 ? argvalue : 1);
    cerr << "Using radius = " << radius << endl;
    
    // Point set shape ?
    //   == 0 => cross_hair()
    //   == 1 => digital_disc()
    int psShape = ( argc > 3 ? atoi(argv[3]) : 0);
    cerr << "Using point set shape = " <<
	    (psShape ? "digital_disc()" : "cross_hair()") << endl;


    IA_Image<IA_Point<int>,u_char>
	a = read_uchar_PGM(cin);

    // Now we have to decide how to define the neighborhood.
    unsigned int  nbhd_dim = a.domain().dim();

    // Define a neighborhood of the appropriate dimension and
    //   shape.
    IA_Point<int>
	origin = extend_to_point( int(0), nbhd_dim );
    IA_Set<IA_Point<int> >
	nbhd_ps = ( psShape ?
		    digital_disc( origin, radius ) :
		    cross_hair( origin, radius ) );

    IA_Neighborhood<IA_Point<int>,IA_Point<int> >
	mm_nbhd( nbhd_dim, nbhd_ps );

    a = max_min_sharpening( a, mm_nbhd, iterationCount );
    
    a.write_PGM(cout);

    return 0;
}
@


1.2
log
@Modifed include stmts to be iac++ 2.0 compliant.
@
text
@d1 1
a1 1
// test-max-min.c    Section: 2.6
d24 1
a24 1
    unsigned int  iterationCount(argvalue > 1 ? argvalue : 1);
d29 1
a29 1
    unsigned int  radius(argvalue > 1 ? argvalue : 1);
d41 1
a41 1
	a = IA_Image<IA_Point<int>,u_char>::read_PGM(cin);
d61 2
a62 1
    exit( 0 );
@


1.1
log
@Initial revision
@
text
@a12 1
#include "Neighborhood.h"
d16 1
a16 1
void main(int argc, char *argv[]) {
d61 1
@
