00001 #ifndef RoughlyEqual_h 00002 #define RoughlyEqual_h 00003 00004 00005 template <class ImgT> 00006 bool 00007 roughlyEqual(ImgT a, ImgT b, ImgT tolerance) { 00008 ImgT diff=(a-b).abs(); 00009 return diff<tolerance; 00010 /* 00011 bool eq=true; 00012 for (int i=0; i<diff.dim(); i++) 00013 eq = eq && diff.getValue(i+1)<tolerance.getValue(i+1); 00014 return eq; 00015 */ 00016 } 00017 00018 00019 #endif