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).


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 660 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.

  • size Size of the image on which the dmap will be compute.
  • ch Chamfer distance used.

Definition at line 203 of file dmap.hxx.

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


The documentation for this class was generated from the following files:
Generated on Thu Apr 15 20:17:07 2004 for Olena by doxygen 1.3.6-20040222