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


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

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

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

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

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


desc
@Initial version of the binary image boundaries algorithms.
Note four versions are available,
  [interior|exterior]x[4|8]-boundary.  However they are
  only available for IA_Bit valued images.
@


1.5
log
@Delete unnecessary cast of int value to unsigned int value.
@
text
@// bib.c                Section: 4.2  Binary Image Boundaries
//      Copyright 1994, Center for Computer Vision and Visualization,
//      University of Florida.  All rights reserved.
// Because the iac++ library implementation of bit valued images
//      essentially treats they as logical vs arithmetic images,
//      the operations described in book are not available.
// However, the logical equivalents to the arithmetic operations
//      are available, and are used in the followin implementations.
//      (1-a) => ~a
//      *     => and (operator &)


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


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

    IA_Neighborhood<IA_Point<int>,IA_Point<int> >
	s( a.domain().dim(),
	   cross_hair( IA_Point<int>(0,0), 1 ) );

    return
	(~a) & max( a, s );
}


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

    IA_Neighborhood<IA_Point<int>,IA_Point<int> >
	s( a.domain().dim(),
	   cross_hair( IA_Point<int>(0,0), 1 ) );

    return
	( ~ min( a, s ) ) & a;
}


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

    IA_Neighborhood<IA_Point<int>,IA_Point<int> >
	t( a.domain().dim(),
	   IA_boxy_pset( IA_Point<int>(-1,-1),
			 IA_Point<int>( 1, 1) ) );

    return
	(~a) & max( a, t );
}


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

    IA_Neighborhood<IA_Point<int>,IA_Point<int> >
	t( a.domain().dim(),
	   IA_boxy_pset( IA_Point<int>(-1,-1),
			 IA_Point<int>( 1, 1) ) );

    return
	( ~ min( a, t ) ) & a;
}
@


1.4
log
@Added algorithm name to header.  Made spelling and style changes.
@
text
@a22 1
//	   cross_hair( IA_Point<int>(0,0), (unsigned int) 1 ) );
a34 1
//	   cross_hair( IA_Point<int>(0,0), (unsigned int) 1 ) );
@


1.3
log
@Modified includes to be iac++ 2.0 compliant.
@
text
@d1 1
a1 1
// bib.c                Section: 4.2
d23 2
a24 1
	   cross_hair( IA_Point<int>(0,0), (unsigned int) 1 ) );
d36 2
a37 1
	   cross_hair( IA_Point<int>(0,0), (unsigned int) 1 ) );
@


1.2
log
@Converted each function to only employ BDI images by utilizing the
  logical equivalents to the arithmetic operations described in the IAH.
@
text
@d13 1
a13 1
#include "Neighborhood.h"
@


1.1
log
@Initial revision
@
text
@d4 7
d12 1
a20 1
    IA_Image<IA_Point<int>,u_char> udi_a( a );
d26 1
a26 1
	to_bit( (1 - udi_a) * max( udi_a, s ) );
a32 1
    IA_Image<IA_Point<int>,u_char> udi_a( a );
d38 1
a38 1
	to_bit( (1 - min( udi_a, s )) * udi_a );
a44 1
    IA_Image<IA_Point<int>,u_char> udi_a( a );
d51 1
a51 1
	to_bit( (1 - udi_a) * max( udi_a, t ) );
a57 1
    IA_Image<IA_Point<int>,u_char> udi_a( a );
d64 1
a64 1
	to_bit( (1 - min( udi_a, t )) * udi_a );
@
