00001 #include <Image.H> 00002 #include <DericheFilter.h> 00003 00006 int main(int argc, char* argv[]) 00007 { 00008 using namespace Images; 00009 00010 // image to smooth 00011 BaseImage<2, float> image; 00012 std::ifstream f("image/tiger.inr"); 00013 f >> format("inrimage") >> image; 00014 00015 // initialization of the sigma image 00016 BaseImage<2, float> sigma(image.shape()); 00017 for (BaseImage<2, float>::iterator<domain> i=sigma.begin() ; i!=sigma.end() ; ++i ) 00018 sigma(i) = (i(1)+100)/100.0; 00019 00020 DericheFilter<2,float> deriche(sigma); 00021 00022 // filter the image 00023 deriche.filter(image); 00024 00025 std::ofstream f1("2D_SpaceVariant_Blur.inr"); 00026 f1 << format("inrimage") << image; 00027 f1.close(); 00028 00029 return 0; 00030 }