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 00011 //: Sample grid from image, using bilinear interpolation 00012 // Grid points are p+i.u+j.v where i=[0..n1-1], j=[0..n2-1] 00013 // Vector vec is resized to n1*n2*np elements, where np=image.nplanes(). 00014 // vec[0]..vec[np-1] are the values from point p 00015 // Samples are taken along direction v first, then along u. 00016 // Points outside image return zero. 00017 // \relates vimt_image_2d_of 00018 template <class imType, class vecType> 00019 void vimt_sample_grid_bilin(vnl_vector<vecType>& vec, 00020 const vimt_image_2d_of<imType>& image, 00021 const vgl_point_2d<double>& p, 00022 const vgl_vector_2d<double>& u, 00023 const vgl_vector_2d<double>& v, 00024 int n1, int n2); 00025 00026 #endif // vimt_sample_grid_bilin_h_
1.4.4