contrib/mul/vimt/vimt_sample_grid_bilin.h
Go to the documentation of this file.
00001 #ifndef vimt_sample_grid_bilin_h_
00002 #define vimt_sample_grid_bilin_h_
00003 //:
00004 // \file
00005 // \brief Grid sampling functions for 2D images
00006 // \author Tim Cootes
00007 
00008 #include <vimt/vimt_image_2d_of.h>
00009 #include <vnl/vnl_fwd.h>
00010 #include <vgl/vgl_fwd.h>
00011 
00012 //: Sample grid from image, using bilinear interpolation
00013 //  Grid points are p+i.u+j.v where i=[0..n1-1], j=[0..n2-1]
00014 //  Vector vec is resized to n1*n2*np elements, where np=image.nplanes().
00015 //  vec[0]..vec[np-1] are the values from point p
00016 //  Samples are taken along direction v first, then along u.
00017 //  Points outside image return zero.
00018 // \relatesalso vimt_image_2d_of
00019 template <class imType, class vecType>
00020 void vimt_sample_grid_bilin(vnl_vector<vecType>& vec,
00021                             const vimt_image_2d_of<imType>& image,
00022                             const vgl_point_2d<double>& p,
00023                             const vgl_vector_2d<double>& u,
00024                             const vgl_vector_2d<double>& v,
00025                             int n1, int n2);
00026 
00027 //: Sample grid from image, using bilinear interpolation
00028 //  Grid points are p+i.u+j.v where i=[0..n1-1], j=[0..n2-1]
00029 //  Vector vec is resized to n1*n2*np elements, where np=image.nplanes().
00030 //  vec[0]..vec[np-1] are the values from point p
00031 //  Samples are taken along direction v first, then along u.
00032 //  Points outside image return NA.
00033 // \relatesalso vimt_image_2d_of
00034 template <class imType, class vecType>
00035 void vimt_sample_grid_bilin_edgena(vnl_vector<vecType>& vec,
00036                                    const vimt_image_2d_of<imType>& image,
00037                                    const vgl_point_2d<double>& p,
00038                                    const vgl_vector_2d<double>& u,
00039                                    const vgl_vector_2d<double>& v,
00040                                    int n1, int n2);
00041 #endif // vimt_sample_grid_bilin_h_