00001 /*!@file Foveator/PyrFoveator.H Foveator class that builds dyadic pyramid */ 00002 00003 // $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/Foveator/PyrFoveator.H $ 00004 // $Id: PyrFoveator.H 4663 2005-06-23 17:47:28Z rjpeters $ 00005 00006 #ifndef PYRFOVEATOR_H_DEFINED 00007 #define PYRFOVEATOR_H_DEFINED 00008 00009 #include "Foveator/Foveator.H" 00010 #include "Image/PyrBuilder.H" 00011 00012 //! A class that does space-variant processing with dyadic pyramid 00013 /*! A Gaussian pyramid is constructed from the original image, each level 00014 with resolution halved, image size 1/4 of previous level. After building the 00015 pyramid, a foveated image is reassembled by starting with low-resolution 00016 image expanded to full-size, then superimposing smaller rectangles of higher 00017 resolution. 00018 00019 Testing has shown that PyrFoveator is somewhat faster than BlurFoveator and 00020 can perform similar blurring, but PyrFoveator creates noticeable straight-line 00021 boundaries between rectangles of differing resolution. 00022 */ 00023 00024 class PyrFoveator : public Foveator 00025 { 00026 private: 00027 GaussianPyrBuilder< PixRGB< byte > > builder; 00028 Dims baseRect; 00029 00030 public: 00031 //! Construct a PyrFoveator for img 00032 /*! This constructor will create a PyrFoveator that handles img and all 00033 other images of the same dimensions. 00034 @param img image to be foveated 00035 @param filterSize size of blur filter to be applied 00036 */ 00037 PyrFoveator( const Image< PixRGB<byte> >& img, int filterSize ); 00038 //! Construct a PyrFoveator from another 00039 PyrFoveator( const PyrFoveator& pf ); 00040 //! Construct a PyrFoveator equal to another 00041 PyrFoveator& operator=( const PyrFoveator& pf ); 00042 //! Destructor 00043 ~PyrFoveator(); 00044 00045 //! Set dimensions of smallest rectangle with highest resolution 00046 void setBaseRect( Dims &d ); 00047 //! Set dimensions of smallest rectangle with highest resolution 00048 void setBaseRect( int x, int y ); 00049 00050 //! Perform dyadic pyramid foveation and return resulting image 00051 Image< PixRGB<byte> > foveate( void ); 00052 //! Perform one dyadic pyramid foveation without a PyrFoveator 00053 /*! This function is for foveating ONE image with a call such as 00054 PyrFoveator::foveate(). It is not optimized for foveating multiple 00055 images. 00056 @param img image to be foveated 00057 @param filterSize size of blur filter to be applied 00058 @param baseRectWidth width of base rectangle 00059 @param baseRectHeight height of base rectangle 00060 @param x horizontal coordinate of origin 00061 @param y vertical coordinate of origin 00062 */ 00063 static Image< PixRGB<byte> > foveate( const Image< PixRGB<byte> >& img, 00064 int filterSize, int baseRectWidth, 00065 int baseRectHeight, int x, int y ); 00066 }; 00067 00068 #endif 00069 00070 // ###################################################################### 00071 /* So things look consistent in everyone's emacs... */ 00072 /* Local Variables: */ 00073 /* indent-tabs-mode: nil */ 00074 /* End: */