因为要做纹理合成方面的研究,急需该代码。
    分不够可以再给。

解决方案 »

  1.   

    The Gaussian PyramidHere we call a pyramid a collection of representations of an image. In our case each layer of the pyramid is half the width and half the heigth of the previous layer.In a Gaussian pyramid, each layer is smoothed by a symmetric Gaussian kernel and resampled to get next layer. These pyramids are most convinient if the image dimensions are a power of two, or a multiple of a power of two. The smallest image is the most heavily smoothed; the layers are often reffered to as coarse scale versions of the image. The algorithm of gaussian pyramid : 
    Set the finest scale layer to the imageFor Each layer, going from next to finest to coarsest
     Obtain this layer by smoothing
     the next finest layer with a
     Gaussian, and then subsampling itend
    Or in mathematical language, defining Next as new image and Prev as a source image : 
     where w is Gaussian kernel.
      

  2.   

    http://ltilib.sourceforge.net/doc/html/classlti_1_1gaussianPyramid.html
      

  3.   

    00033 #ifndef _LTI_GAUSSIAN_PYRAMID_H_
    00034 #define _LTI_GAUSSIAN_PYRAMID_H_
    00035 
    00036 #include "ltiPyramid.h"
    00037 #include "ltiTypes.h"
    00038 
    00039 namespace lti {
    00040   /**
    00041    * GaussianPyramid class.
    00042    *
    00043    * This class implements the gaussian pyramids as described in
    00044    * Greenspan et.at. "Overcomplete Steerable Pyramid Filters and
    00045    * Rotation Invariance", Proc. of the IEEE Conf. on Computer Visiona
    00046    * and Pattern Recognition, Seattle, 1994
    00047    *
    00048    * It allows an easy manipulation of the different resolutions.
    00049    *
    00050    * See method generate() to an detailed explanation.
    00051    *
    00052    * The template type T is the type of the elements in the pyramid.
    00053    *
    00054    * Example:
    00055    *
    00056    * \code
    00057    *
    00058    * channel chnl;
    00059    * // initialize channel or load it from an image...
    00060    *
    00061    * lti::gaussianPyramid<lti::channel> thePyramid(4); // four levels
    00062    * thePyramid.generate(chnl); // generate a pyramid for the given channel
    00063    *
    00064    * \endcode
    00065    */
    00066   template <class T>
    00067   class gaussianPyramid : public pyramid<T> {
    00068   public:
    00069 
    00070     /**
    00071      * create a gaussian pyramid with the given number of resolutions
    00072      * @param resolutions the number of resolutions that the pyramid can hold
    00073      *                    (default 0: an empty pyramid will be created)
    00074      * @param upsampleWithGaussian a gaussian kernel will be used to
    00075      *                             upsample the images.  If false a squared
    00076      *                             kernel will be used.
    00077      *
    00078      * @param gaussianSize the size of the gaussian kernel (default 3)
    00079      * @param variance the variance of the gaussian kernel (default -1, meaning
    00080      *                 that the variance should be calculated as described in
    00081      *                 the lti::gaussKernel1D<T>)
    00082      */
    00083     gaussianPyramid(const int& resolutions = 0,
    00084                     const int& gaussianSize = 3,
    00085                     const double& variance = -1,
    00086                     const bool& upsampleWithGaussian = true);
    00087 
    00088     /**
    00089      * create this gaussianPyramid as a copy of another gaussianPyramid
    00090      * @param other the gaussianPyramid to be copied.
    00091      */
    00092     gaussianPyramid(const gaussianPyramid& other);
    00093 
    00094     /**
    00095      * destructor
    00096      */
    00097     virtual ~gaussianPyramid();
    00098 
    00099     /**
    00100      * return the size and variance of the used gaussian kernel
    00101      */
    00102     void getKernelParameters(int& size,
    00103                              double& variance,
    00104                              bool& gaussian) const;
    00105 
    00106     /**
    00107      * set the kernel parameters
    00108      *
    00109      * @param size the size of the kernel
    00110      * @param variance the variance for the gaussian kernel.  A negative
    00111      *                 value will force the default variance of a gaussian
    00112      *                 kernel with size <code>size</code>.
    00113      * @param gaussian specify if for the channel upsampling a gaussian or
    00114      *                 a rectangular kernel should be used.
    00115      */
    00116     void setKernelParameters(const int& size,
    00117                              const double& variance=-1,
    00118                              const bool& gaussian = true);
    00119 
    00120     /**
    00121      * returns the name of this class: "gaussianPyramid"
    00122      */
    00123     const char* getTypeName() const {return "gaussianPyramid";};
    00124 
    00125     /**
    00126      * assigment operator.
    00127      * copy the contents of <code>other</code> in this %object.
    00128      * @param other the source gaussianPyramid to be copied.
    00129      * @return a reference to this object
    00130      */
    00131     gaussianPyramid<T>& copy(const gaussianPyramid<T>& other);
    00132 
    00133     /**
    00134      * create a clone of this gaussianPyramid
    00135      * @return a pointer to a copy of this gaussianPyramid
    00136      */
    00137     virtual mathObject* clone() const;
    00138 
    00139     /**
    00140      * generate the gaussian pyramid of the given object.
    00141      *
    00142      * The pyramid will contain the number of resolutions specified in
    00143      * the construction or in the resize() method.  The resolution "0"
    00144      * will correspond the the original channel, and the resolution
    00145      * i+1 is always a factor 2 smaller than the resolution i.
    00146      */
    00147     void generate(const T& src);
    00148 
    00149     /**
    00150      * generate the gaussian pyramid of the given object.
    00151      *
    00152      * The pyramid will contain the number of resolutions specified
    00153      * by theResolutions.
    00154      * The resolution "0" will correspond the the original channel,
    00155      * and the resolution i+1 is always a factor 2 smaller than
    00156      * the resolution i.
    00157      */
    00158     void generate(const T& src,const int& theResolutions);
    00159 
    00160     /**
    00161      * generate the gaussian pyramid of the given object. Proceed, until
    00162      * given limit.x or limit.y is reached. smallest resolution will be > limit.
    00163      *
    00164      * The resolution "0" corresponds to the original channel, and the resolution
    00165      * i+1 is always a factor 2 smaller than the resolution i.
    00166      */
    00167     void generate(const T& src, const lti::point& limit);
    00168 
    00169     /**
    00170      * reconstructs the resolution with index i from a second resolution j.
    00171      * If i>j, the object at(i) will be returned, otherwise the corresponding
    00172      * upsampling will be done with the kernel type specified in the
    00173      * construction
    00174      *
    00175      * @param i the resolution to be reconstructed
    00176      * @param fromJ the resolution from which the data is to be taken.
    00177      * @param result the resulting object
    00178      * @return a reference to the result object.
    00179      */
    00180     T& reconstruct(const int& i, const int& fromJ, T& result) const;
    00181 
    00182     /**
    00183      * reconstructs the resolution with index i from a second
    00184      * resolution j.
    00185      * If i>j, the object the same pyramid will be
    00186      * returned, otherwise the corresponding upsampling will be done
    00187      * with the kernel type specified in the construction
    00188      * A pyramid with the same original size will be returned, where only
    00189      * the elements between i and fromJ will be initialized.
    00190      *
    00191      * @param i the resolution to be reconstructed
    00192      * @param fromJ the resolution from which the data is to be taken.
    00193      * @param result the resulting pyramid.
    00194      * @return a reference to the result pyramid
    00195      */
    00196     pyramid<T>& reconstruct(const int& i, const int& fromJ,
    00197                             pyramid<T>& result) const;
    00198 
    00199   protected:
    00200 
    00201     /**
    00202      * kernel size
    00203      */
    00204     int kernelSize;
    00205 
    00206     /**
    00207      * kernel variance
    00208      */
    00209     double kernelVariance;
    00210 
    00211     /**
    00212      * specify if the upsampling kernel is gaussian (true) or
    00213      * rectangular(false)
    00214      */
    00215     bool gaussian;
    00216   };
    00217 
    00218 } // namespace lti
    00219 
    00220 #include "ltiGaussianPyramid_template.h"
    00221 
    00222 #endif
      

  4.   

    lti::gaussianPyramid< T > Member List
    This is the complete list of members for lti::gaussianPyramid< T >, including all inherited members.append(const T &theElement) lti::pyramid< T >  at(const int &x) const  lti::pyramid< T > [inline] 
    at(const int &x) lti::pyramid< T > [inline] 
    begin() const  lti::pyramid< T > [inline] 
    begin() lti::pyramid< T > [inline] 
    clear() lti::pyramid< T >  
    clone() const  lti::gaussianPyramid< T > [virtual] 
    compareResolutions(const pyramid &other) const  lti::pyramid< T >  
    const_iterator typedef lti::pyramid< T >  
    copy(const gaussianPyramid< T > &other) lti::gaussianPyramid< T >  
    lti::pyramid::copy(const pyramid< T > &other) lti::pyramid< T >  
    lti::mathObject::copy(const ioObject &other) lti::ioObject  
    end() const  lti::pyramid< T > [inline] 
    end() lti::pyramid< T > [inline] 
    equals(const pyramid &other) const  lti::pyramid< T >  
    gaussian lti::gaussianPyramid< T > [protected] 
    gaussianPyramid(const int &resolutions=0, const int &gaussianSize=3, const double &variance=-1, const bool &upsampleWithGaussian=true) lti::gaussianPyramid< T >  
    gaussianPyramid(const gaussianPyramid &other) lti::gaussianPyramid< T >  
    generate(const T &src) lti::gaussianPyramid< T >  
    generate(const T &src, const int &theResolutions) lti::gaussianPyramid< T >  
    generate(const T &src, const lti::point &limit) lti::gaussianPyramid< T >  
    getKernelParameters(int &size, double &variance, bool &gaussian) const  lti::gaussianPyramid< T >  
    getTypeName() const  lti::gaussianPyramid< T > [inline, virtual] 
    initialize() lti::object [protected] 
    ioObject() lti::ioObject  
    ioObject(const ioObject &other) lti::ioObject  
    iterator typedef lti::pyramid< T >  
    kernelSize lti::gaussianPyramid< T > [protected] 
    kernelVariance lti::gaussianPyramid< T > [protected] 
    ltiLibInitialized lti::object [protected, static] 
    object() lti::object  
    operator=(const pyramid &other) lti::pyramid< T > [inline] 
    lti::mathObject::operator=(const ioObject &other) lti::ioObject  
    operator==(const pyramid &other) const  lti::pyramid< T > [inline] 
    operator[](const int &x) const  lti::pyramid< T > [inline] 
    operator[](const int &x) lti::pyramid< T > [inline] 
    pyramid() lti::pyramid< T >  
    pyramid(const int &resolutions) lti::pyramid< T >  
    pyramid(const pyramid &other) lti::pyramid< T >  
    read(ioHandler &handler, const bool &complete=true) lti::mathObject [virtual] 
    reconstruct(const int &i, const int &fromJ, T &result) const  lti::gaussianPyramid< T >  
    reconstruct(const int &i, const int &fromJ, pyramid< T > &result) const  lti::gaussianPyramid< T >  
    resize(const int &resolutions, const bool &copyData=true) lti::pyramid< T >  
    setKernelParameters(const int &size, const double &variance=-1, const bool &gaussian=true) lti::gaussianPyramid< T >  
    size() const  lti::pyramid< T > [inline] 
    size_type typedef lti::pyramid< T >  
    thePyramid lti::pyramid< T > [protected] 
    write(ioHandler &handler, const bool &complete=true) const  lti::mathObject [virtual] 
    ~gaussianPyramid() lti::gaussianPyramid< T > [virtual] 
    ~ioObject() lti::ioObject [virtual] 
    ~object() lti::object [virtual] 
    ~pyramid() lti::pyramid< T > [virtual]