oln::topo::dmap< T, T2 > Class Template Reference

#include <dmap.hh>

Collaboration diagram for oln::topo::dmap< T, T2 >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef image2d< ntg::bin
>::point_type 
point_type

Public Member Functions

 dmap (const image2d_size &size, const chamfer< T2 > &ch)
template<class V>
void compute (const image2d< V > &input, float infty=0.f)
 Compute the distance map.
template<class V>
void compute (const image2d< V > &input, image2d< point2d > &nearest_point_map, float infty=0.f)
 Compute the distance map.
const image2d< T > & imap () const
 Return the distance map of type T.
image2d< float > to_image () const
 Return the distance map divided by the Chamfer coefficient.
const T operator[] (const point_type &p) const
 Distance of a point p.
const T operator() (coord row, coord col) const
 Distance of a point2d(row, col).
template<class V>
void compute (const image2d< V > &input, image2d< point_type > &nearest_point_map, float infty)

Detailed Description

template<class T, class T2>
class oln::topo::dmap< T, T2 >

Distance map

Parameters:
T Type of the distance.
T2 Type of the chamfer distance.
Note:
Do not forget to call compute.
 #include <oln/basics2d.hh>
 #include <oln/topo/dmap.hh>
 #include <oln/convert/stretch.hh>

 int main()
 {
   oln::image2d<ntg::bin> in = oln::load(IMG_IN "face_se.pbm");

   oln::topo::dmap<ntg::int_u<16>, int> m(in.size(), oln::topo::chessboard());
   m.compute(in);
   save(oln::convert::stretch_balance<ntg::int_u8>(m.imap()),
        IMG_OUT "oln_topo_dmap.pgm");
 }
face_se_pbm.png
=>
oln_topo_dmap.png

Definition at line 661 of file dmap.hh.


Constructor & Destructor Documentation

template<class T, class T2>
oln::topo::dmap< T, T2 >::dmap ( const image2d_size size,
const chamfer< T2 > &  ch 
)

Constructor.

Definition at line 204 of file dmap.hxx.

00205                                              :
00206       imap_(size),
00207       ch_(ch)
00208     {
00209       // FIXME: if T is float then precondition(ch.coef == 1.f)
00210     }


The documentation for this class was generated from the following files:
Generated on Tue Feb 20 20:29:21 2007 for Olena by  doxygen 1.5.1