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


1.5
date	95.01.09.17.38.22;	author rjj;	state Exp;
branches;
next	1.4;

1.4
date	95.01.09.17.14.47;	author rjj;	state Exp;
branches;
next	1.3;

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

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

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


desc
@Initial version for the Hueckel algorithm suite.
@


1.5
log
@Forgot to remove all related variables for the unused and now
   unsupported third input variable.
@
text
@// test-hueckel.c     Section: 6.15, Hueckel Edge Operator
//      Copyright 1994, Center for Computer Vision and Visualization,
//      University of Florida.  All rights reserved.
//
// Test the hueckel.[ch] file stuff

#include "hueckel.h"
#include "scale-to-uchar.h"


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

    // We accept up to three arguments:
    // 1st arg: RADIUS,    default = 4
    // 2nd arg: THETA_M,   default = 4
    unsigned int RADIUS, THETA_M, i_arg;

    i_arg  = ( argc > 1 ? atoi(argv[1]) : 0 );
    RADIUS = ( i_arg > 0 ? i_arg : 4 );

    // We will allow almost any value > 0, but default to 4
    i_arg = ( argc > 2 ? atoi(argv[2]) : 0 );
    THETA_M   = ( i_arg > 0 ? i_arg : 4 );

    cerr << "\nRADIUS = "  << RADIUS
	 << "\tTHETA_M = " << THETA_M << endl;

    double *theta = new double[THETA_M];

    theta[0] = 0.0;
    for( int m=1; m<THETA_M; m++) {
	theta[m] = double(m) * M_PI / THETA_M;
    }


    IA_Image<IA_Point<int>,u_char>
	in( IA_Image<IA_Point<int>,u_char>::read_PGM(cin) ),
	out;

    IA_Image<IA_Point<int>,float>
	fout = hueckel2D( IA_Image<IA_Point<int>,float>( in ),
			 double(RADIUS),
			 theta, THETA_M );

    out = scale_to_uchar( fout );
    out.write_PGM(cout);

    return 0;
}
@


1.4
log
@Added standard header.
Deleted unnecessary comments and commented out lines.
@
text
@a24 2
    d_arg = ( argc > 3 ? atof(argv[3]) : 0.0 );

@


1.3
log
@Added exit() to main for pickey systems.  Also added standard file header.
@
text
@d1 1
a1 1
// test-hueckel.c     Section: 6.15
a6 1
#include <iostream.h>
a15 1
    // 3rd arg: THRESHOLD, default = 0.9
a16 1
    double THRESHOLD, d_arg;
d18 2
a19 2
    i_arg = ( argc > 1 ? atoi(argv[1]) : 0 );
    RADIUS    = ( i_arg > 0 ? i_arg : 4 );
a25 1
    THRESHOLD = ( d_arg > 0  ? d_arg : 0.9 ); 
d27 2
a29 6
    cerr << "\nRADIUS = " << RADIUS
	 << "\tTHETA_M = " << THETA_M
	 << "\tTHRESHOLD = " << THRESHOLD << " *ignored* "
	 << endl;


d50 1
a50 1
    exit( 0 );
@


1.2
log
@Extracted my_to_uchar() function and am now using scale_to_uchar().
@
text
@d1 4
a4 1
// test-hueckel.c
d12 1
a12 1
void main(int argc, char *argv[]) {
d57 2
@


1.1
log
@Initial revision
@
text
@d6 1
a8 26
#include "UcharDI.h"
void display_FDI( const IA_Image<IA_Point<int>,float> & fdi ) {
    IA_Array<float>  fdi_values = fdi.value_array();

    float fmin = fdi_values[0], fmax = fdi_values[0];
    for( int i=0; i<fdi_values.len(); i++ ) {
	float tmp = fdi_values[i];
	if (tmp < fmin) fmin = tmp;
	if (tmp > fmax) fmax = tmp;

    }
    cerr << __FILE__ << "::display_FDI: fmin = " << fmin
	 << "\tfmax = " << fmax << endl;
    IA_Array<u_char> udi_values( fdi_values.len() );
    fmax -= fmin;
    for( i=0; i<fdi_values.len(); i++ ) {
	udi_values[i] = u_char( 256.0*(fdi_values[i] - fmin)/fmax );
    }
    IA_Image<IA_Point<int>,u_char>( fdi.domain(),
				    udi_values.data_start(),
				    fdi_values.len(),
				    1 ).write_PGM( "/tmp/hueckel.pgm" );
}



d52 1
a52 3
//    display_FDI( fout );

    out = to_uchar( fout );
@
