Image.h

Go to the documentation of this file.
00001 /*
00002 * Copyright (C) 2007-2008 Anael Orlinski
00003 *
00004 * This file is part of Panomatic.
00005 *
00006 * Panomatic is free software; you can redistribute it and/or modify
00007 * it under the terms of the GNU General Public License as published by
00008 * the Free Software Foundation; either version 2 of the License, or
00009 * (at your option) any later version.
00010 *
00011 * Panomatic is distributed in the hope that it will be useful,
00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 * GNU General Public License for more details.
00015 *
00016 * You should have received a copy of the GNU General Public License
00017 * along with Panomatic; if not, write to the Free Software
00018 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 */
00020 
00021 #ifndef __lfeat_image_h
00022 #define __lfeat_image_h
00023 
00024 #include "KeyPoint.h"
00025 #include "vigra/stdimage.hxx"
00026 
00027 namespace lfeat
00028 {
00029 
00030 // forward declaration
00031 class IntegralImage;
00032 
00033 class LFIMPEX Image
00034 {
00035 public:
00036     Image() : _width(0), _height(0), _ii(0) {};
00037 
00038     // Constructor from a pixel array (C style)
00039     Image(vigra::DImage &img);
00040     // setup the integral image
00041     void init(vigra::DImage &img);
00042 
00043     // cleanup
00044     void clean();
00045 
00046     // Destructor
00047     ~Image();
00048 
00049     // Accessors
00050     inline double** getIntegralImage()
00051     {
00052         return _ii;
00053     }
00054     inline unsigned int getWidth()
00055     {
00056         return _width;
00057     }
00058     inline unsigned int getHeight()
00059     {
00060         return _height;
00061     }
00062 
00063     // allocate and deallocate integral image pixels
00064     static double** AllocateImage(unsigned int iWidth, unsigned int iHeight);
00065     static void DeallocateImage(double** iImagePtr, unsigned int iHeight);
00066 
00067 private:
00068 
00069     // prepare the integral image
00070     void buildIntegralImage(vigra::DImage &img);
00071 
00072     // image size
00073     unsigned int _width;
00074     unsigned int _height;
00075 
00076     // integral image
00077     double**_ii; // Data of the integral image Like data[lines][rows]
00078 };
00079 
00080 }
00081 
00082 #endif //__lfeat_image_h
00083 

Generated on 21 Nov 2014 for Hugintrunk by  doxygen 1.4.7