00001 // This is core/vil/vil_sample_grid_bilin.h 00002 #ifndef vil_sample_grid_bilin_h_ 00003 #define vil_sample_grid_bilin_h_ 00004 //: 00005 // \file 00006 // \brief Bilinear grid sampling function for 2D images 00007 // \author Tim Cootes 00008 // 00009 // The vil bicub source files were derived from the corresponding 00010 // vil bilin files, thus the vil bilin/bicub source files are very 00011 // similar. If you modify something in this file, there is a 00012 // corresponding bicub file that would likely also benefit from 00013 // the same change. 00014 00015 #include <vil/vil_image_view.h> 00016 00017 //: Sample grid from image, using bilinear interpolation 00018 // Grid points are (x0+i.dx1+j.dx2,y0+i.dy1+j.dy2), where i=[0..n1-1], j=[0..n2-1] 00019 // Vector v is filled with n1*n2*np elements, where np=image.nplanes()*image.ncomponents() 00020 // v[0]..v[np-1] are the values from point (x0,y0) 00021 // Samples are taken along direction (dx2,dy2) first, then along (dx1,dy1). 00022 // Points outside image return zero. 00023 // \relatesalso vil_image_view 00024 template <class imType, class vecType> 00025 void vil_sample_grid_bilin(vecType* v, 00026 const vil_image_view<imType>& image, 00027 double x0, double y0, double dx1, double dy1, 00028 double dx2, double dy2, int n1, int n2); 00029 00030 //: Sample grid from image, using bilinear interpolation 00031 // Grid points are (x0+i.dx1+j.dx2,y0+i.dy1+j.dy2), where i=[0..n1-1], j=[0..n2-1] 00032 // Vector v is filled with n1*n2*np elements, where np=image.nplanes()*image.ncomponents() 00033 // v[0]..v[np-1] are the values from point (x0,y0) 00034 // Samples are taken along direction (dx2,dy2) first, then along (dx1,dy1). 00035 // Points outside image return NA. 00036 // \relatesalso vil_image_view 00037 template <class imType, class vecType> 00038 void vil_sample_grid_bilin_edgena(vecType* v, 00039 const vil_image_view<imType>& image, 00040 double x0, double y0, double dx1, double dy1, 00041 double dx2, double dy2, int n1, int n2); 00042 00043 #endif // vil_sample_grid_bilin_h_