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


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

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

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


desc
@Initial version of the Salt-and-Pepper noise removal algorithm.
@


1.3
log
@Added standard section header.
@
text
@// snp.c                Section: 5.4, Salt-and-Pepper Noise Removal
//      Copyright 1994, Center for Computer Vision and Visualization,
//      University of Florida.  All rights reserved.
// Salt-and-Pepper-Noise-Removal algorithm.
// This implementation takes advantage of the fact that the algorithm
//      is defined with a characteristic template, and hence a
//      neighborhood reduction may be employed.


#include "Nbh.h"
#include "shaped-pointset.h"
#include "snp.h"


IA_Image<IA_Point<int>,IA_Bit>
snp( const IA_Image<IA_Point<int>,IA_Bit> & a ) {

    unsigned int a_dim = a.domain().dim();

    // Create the neighborhood
    IA_Neighborhood<IA_Point<int>,IA_Point<int> >
	snp_nbhd( a_dim,
		  cross_hair( extend_to_point( 0, a_dim ),
			      1 )
		  );

    // We will apply the algorithm in steps, for readability
    IA_Image<IA_Point<int>,IA_Bit>
	b( min( a, snp_nbhd ) );
    b = max( b, snp_nbhd );
    b = max( b, snp_nbhd );

    // we simply return the final result
    return
	min( b, snp_nbhd );
}
@


1.2
log
@Modified includes to be iac++ 2.0 compliant.
@
text
@d1 1
a1 1
// snp.c                Section: 5.4
@


1.1
log
@Initial revision
@
text
@d10 1
a10 1
#include "Neighborhood.h"
@
