Parcourir la source

substituted MCI by MCI3D in CachedExample; modified FPFeatures accordingly

Sven Sickert il y a 8 ans
Parent
commit
04e93a6d69

+ 41 - 40
cbaselib/CachedExample.cpp

@@ -19,13 +19,13 @@ using namespace OBJREC;
 
 void CachedExample::init ()
 {
-    dchannels = new NICE::MultiChannelImageT<double> [D_NUMCHANNELS];
-    ichannels = new NICE::MultiChannelImageT<int> [I_NUMCHANNELS];
-    lchannels = new NICE::MultiChannelImageT<long> [L_NUMCHANNELS];
+//    dchannels = new NICE::MultiChannelImageT<double> [D_NUMCHANNELS];
+//    ichannels = new NICE::MultiChannelImageT<int> [I_NUMCHANNELS];
+//    lchannels = new NICE::MultiChannelImageT<long> [L_NUMCHANNELS];
 
-    dchannels3 = new NICE::MultiChannelImage3DT<double> [D_NUMCHANNELS];
-    ichannels3 = new NICE::MultiChannelImage3DT<int> [I_NUMCHANNELS];
-    lchannels3 = new NICE::MultiChannelImage3DT<long> [L_NUMCHANNELS];
+    dchannels = new NICE::MultiChannelImage3DT<double> [D_NUMCHANNELS];
+    ichannels = new NICE::MultiChannelImage3DT<int> [I_NUMCHANNELS];
+    lchannels = new NICE::MultiChannelImage3DT<long> [L_NUMCHANNELS];
 
     svmap = new NICE::SparseVector *[SVNUMCHANNELS];
     svmap_xsize = new int [SVNUMCHANNELS];
@@ -101,8 +101,8 @@ CachedExample::CachedExample (
     for ( unsigned int i = 0; i < ozsize; i++ )
         imgfn.push_back("");
 
-    ichannels3[I_GRAYVALUES].freeData();
-    ichannels3[I_GRAYVALUES].addChannel(_img);
+    ichannels[I_GRAYVALUES].freeData();
+    ichannels[I_GRAYVALUES].addChannel(_img);
     hasColorInformation = false;
 }
 
@@ -135,9 +135,9 @@ CachedExample::CachedExample (
     for ( int y = 0 ; y < oysize ; y++ )
         for ( int x = 0 ; x < oxsize ; x++ )
         {
-            ichannels[I_COLOR](x,y,0) = img.getPixel ( x, y, 0 );
-            ichannels[I_COLOR](x,y,1) = img.getPixel ( x, y, 1 );
-            ichannels[I_COLOR](x,y,2) = img.getPixel ( x, y, 2 );
+            ichannels[I_COLOR](x,y,0,0) = img.getPixel ( x, y, 0 );
+            ichannels[I_COLOR](x,y,0,1) = img.getPixel ( x, y, 1 );
+            ichannels[I_COLOR](x,y,0,2) = img.getPixel ( x, y, 2 );
         }
 
     hasColorInformation = true;
@@ -162,8 +162,8 @@ CachedExample::CachedExample (
 
     if ( ! disableGrayConversion && (ochannels > 2) )
     {
-        ichannels3[I_GRAYVALUES].freeData();
-        ichannels3[I_GRAYVALUES].addChannel(1);
+        ichannels[I_GRAYVALUES].freeData();
+        ichannels[I_GRAYVALUES].addChannel(1);
         for ( int z = 0; z < ozsize; z++ )
         {
             NICE::Image imggray;
@@ -171,11 +171,11 @@ CachedExample::CachedExample (
 
             for ( int y = 0; y < oysize; y++ )
                 for ( int x = 0; x < oxsize; x++ )
-                    ichannels3[I_GRAYVALUES](x,y,z,0) = imggray.getPixel(x,y);
+                    ichannels[I_GRAYVALUES](x,y,z,0) = imggray.getPixel(x,y);
         }
     }
 
-    ichannels3[I_COLOR].addChannel ( img );
+    ichannels[I_COLOR].addChannel ( img );
 
     hasColorInformation = true;
 }
@@ -186,9 +186,9 @@ CachedExample::~CachedExample()
     delete [] ichannels;
     delete [] lchannels;
 
-    delete [] dchannels3;
-    delete [] ichannels3;
-    delete [] lchannels3;
+//    delete [] dchannels3;
+//    delete [] ichannels3;
+//    delete [] lchannels3;
 
     for ( uint k = 0 ; k < SVNUMCHANNELS ; k++ )
         if ( svmap[k] != NULL )
@@ -250,14 +250,14 @@ void CachedExample::readImageData ()
             oxsize = imggray.width();
             oysize = imggray.height();
 
-            ichannels3[I_GRAYVALUES].reInit( oxsize, oysize, ozsize, 1);
-            ichannels[I_GRAYVALUES].freeData();
-            ichannels[I_GRAYVALUES].addChannel(imggray);
+            ichannels[I_GRAYVALUES].reInit( oxsize, oysize, ozsize, 1);
+            //ichannels[I_GRAYVALUES].freeData();
+            //ichannels[I_GRAYVALUES].addChannel(imggray);
         }
 
         for ( int y = 0; y < oysize; y++ )
             for ( int x = 0; x < oxsize; x++ )
-                ichannels3[I_GRAYVALUES](x,y,z,0) = imggray.getPixel(x,y);
+                ichannels[I_GRAYVALUES](x,y,z,0) = imggray.getPixel(x,y);
     }
 }
 
@@ -287,19 +287,19 @@ void CachedExample::readImageDataRGB ()
             hasColorInformation = true;
 
             // FIXME: see readImageData issue
-            ichannels3[I_COLOR].reInit ( oxsize, oysize, ozsize, 3);
-            ichannels[I_COLOR].reInit ( oxsize, oysize, 3);
+            ichannels[I_COLOR].reInit ( oxsize, oysize, ozsize, 3);
+            //ichannels[I_COLOR].reInit ( oxsize, oysize, 3);
         }
 
         for ( int y = 0; y < oysize; y++ )
             for ( int x = 0; x < oxsize; x++ )
             {
-                ichannels3[I_COLOR](x,y,z,0) = img.getPixel(x,y,0);
-                ichannels3[I_COLOR](x,y,z,1) = img.getPixel(x,y,1);
-                ichannels3[I_COLOR](x,y,z,2) = img.getPixel(x,y,2);
-                ichannels[I_COLOR](x,y,0) = img.getPixel ( x, y, 0 );
-                ichannels[I_COLOR](x,y,1) = img.getPixel ( x, y, 1 );
-                ichannels[I_COLOR](x,y,2) = img.getPixel ( x, y, 2 );
+                ichannels[I_COLOR](x,y,z,0) = img.getPixel(x,y,0);
+                ichannels[I_COLOR](x,y,z,1) = img.getPixel(x,y,1);
+                ichannels[I_COLOR](x,y,z,2) = img.getPixel(x,y,2);
+                //ichannels[I_COLOR](x,y,0) = img.getPixel ( x, y, 0 );
+                //ichannels[I_COLOR](x,y,1) = img.getPixel ( x, y, 1 );
+                //ichannels[I_COLOR](x,y,2) = img.getPixel ( x, y, 2 );
             }
     }
 }
@@ -307,6 +307,7 @@ void CachedExample::readImageDataRGB ()
 void CachedExample::calcIntegralImage ()
 {
     // in case of standard 2D images
+/*
     if ( ozsize == 1 )
     {
         if ( ichannels[I_GRAYVALUES].width() == 0 )
@@ -334,7 +335,7 @@ void CachedExample::calcIntegralImage ()
     }
     // in case of a 3D images
     else
-    {
+    {*/
         if ( ichannels[I_GRAYVALUES].width() == 0 )
         {
             readImageData ();
@@ -345,24 +346,24 @@ void CachedExample::calcIntegralImage ()
             }
         }
 
-        int nwidth = ichannels3[I_GRAYVALUES].width();
-        int nheight = ichannels3[I_GRAYVALUES].height();
-        int ndepth = ichannels3[I_GRAYVALUES].depth();
-        int nchannels = ichannels3[I_GRAYVALUES].channels();
-        lchannels3[L_INTEGRALIMAGE].reInit( nwidth, nheight, ndepth, nchannels);
+        int nwidth = ichannels[I_GRAYVALUES].width();
+        int nheight = ichannels[I_GRAYVALUES].height();
+        int ndepth = ichannels[I_GRAYVALUES].depth();
+        int nchannels = ichannels[I_GRAYVALUES].channels();
+        lchannels[L_INTEGRALIMAGE].reInit( nwidth, nheight, ndepth, nchannels);
         for ( int c = 0; c < nchannels; c++ )
         {
             for ( int z = 0; z < ndepth; z++ )
                 for ( int y = 0; y < nheight; y++ )
                     for ( int x = 0; x < nwidth; x++ )
                     {
-                        lchannels3[L_INTEGRALIMAGE](x,y,z,c) =
-                                (long)ichannels3[L_INTEGRALIMAGE].get(x,y,z,c);
+                        lchannels[L_INTEGRALIMAGE](x,y,z,c) =
+                                (long)ichannels[L_INTEGRALIMAGE].get(x,y,z,c);
                     }
 
-            lchannels3[L_INTEGRALIMAGE].calcIntegral(c);
+            lchannels[L_INTEGRALIMAGE].calcIntegral(c);
         }
-    }
+//    }
 }
 
 void CachedExample::buildIntegralSV (

+ 32 - 32
cbaselib/CachedExample.h

@@ -46,16 +46,16 @@ class CachedExample
     std::vector<std::string> imgfn;
 
     /** array of double images */
-    NICE::MultiChannelImageT<double> *dchannels;
-    NICE::MultiChannelImage3DT<double> *dchannels3;
+//    NICE::MultiChannelImageT<double> *dchannels;
+    NICE::MultiChannelImage3DT<double> *dchannels;
 
     /** array of integer images */
-    NICE::MultiChannelImageT<int> *ichannels;
-    NICE::MultiChannelImage3DT<int> *ichannels3;
+//    NICE::MultiChannelImageT<int> *ichannels;
+    NICE::MultiChannelImage3DT<int> *ichannels;
 
     /** array of histogram images */
-    NICE::MultiChannelImageT<long> *lchannels;
-    NICE::MultiChannelImage3DT<long> *lchannels3;
+//    NICE::MultiChannelImageT<long> *lchannels;
+    NICE::MultiChannelImage3DT<long> *lchannels;
 
     /** maps for temporary files */
     std::map<int, std::string> dtemps;
@@ -183,13 +183,13 @@ class CachedExample
         @param channel channel type (choose from enum type)
         @return buffer to image data
     */
-    inline NICE::MultiChannelImageT<double> & getDChannel ( int channel );
+//    inline NICE::MultiChannelImageT<double> & getDChannel ( int channel );
 
     /** get double image channel 3d
         @param channel channel type (choose from enum type)
         @return buffer to image data
     */
-    inline NICE::MultiChannelImage3DT<double> & getDChannel3 ( int channel );
+    inline NICE::MultiChannelImage3DT<double> & getDChannel ( int channel );
 
     /** get integer image channel
         @param channel channel type (choose from enum type)
@@ -197,13 +197,13 @@ class CachedExample
         @param[out] ysize height of image
         @return buffer to image data
     */
-    inline NICE::MultiChannelImageT<int> & getIChannel ( int channel );
+//    inline NICE::MultiChannelImageT<int> & getIChannel ( int channel );
 
     /** get integer image channel 3d
         @param channel channel type (choose from enum type)
         @return buffer to image data
     */
-    inline NICE::MultiChannelImage3DT<int> & getIChannel3 ( int channel );
+    inline NICE::MultiChannelImage3DT<int> & getIChannel ( int channel );
 
     /** get long image channel
         @param channel channel type (choose from enum type)
@@ -211,13 +211,13 @@ class CachedExample
         @param[out] ysize height of image
         @return buffer to image data
     */
-    inline NICE::MultiChannelImageT<long> & getLChannel ( int channel );
+//    inline NICE::MultiChannelImageT<long> & getLChannel ( int channel );
 
     /** get long image channel 3d
         @param channel channel type (choose from enum type)
         @return buffer to image data
     */
-    inline NICE::MultiChannelImage3DT<long> & getLChannel3 ( int channel );
+    inline NICE::MultiChannelImage3DT<long> & getLChannel ( int channel );
 
     /** get histogram image
         @param svchannel channel type (choose from histogram channel enum)
@@ -271,7 +271,7 @@ class CachedExample
     void dropPreCached();
 
     template<class ImgPixelValue>
-    void dropImages ( NICE::MultiChannelImageT<ImgPixelValue> *images,
+    void dropImages ( NICE::MultiChannelImage3DT<ImgPixelValue> *images,
                       std::map<int, std::string> & temps,
                       int numImages );
 };
@@ -287,7 +287,7 @@ inline int CachedExample::getNumImages ()
 {
     return imgfn.size();
 }
-
+/*
 inline NICE::MultiChannelImageT<double> & CachedExample::getDChannel ( int channel )
 {
   assert ( ( channel >= 0 ) && ( channel < D_NUMCHANNELS ) );
@@ -310,12 +310,12 @@ inline NICE::MultiChannelImageT<double> & CachedExample::getDChannel ( int chann
 
   return dchannels[channel];
 }
-
-inline NICE::MultiChannelImage3DT<double> & CachedExample::getDChannel3 ( int channel )
+*/
+inline NICE::MultiChannelImage3DT<double> & CachedExample::getDChannel ( int channel )
 {
     assert ( ( channel >= 0 ) && ( channel < D_NUMCHANNELS ) );
 
-    if ( dchannels3[channel].channels() == 0 )
+    if ( dchannels[channel].channels() == 0 )
     {
         std::map<int, std::string>::const_iterator j = dtemps.find ( channel );
         if ( j == dtemps.end() )
@@ -326,14 +326,14 @@ inline NICE::MultiChannelImage3DT<double> & CachedExample::getDChannel3 ( int ch
         else
         {
             //fprintf (stderr, "NICE::MultiChannelImageT: restoring data from %s ", j->second.c_str() );
-            dchannels3[channel].restore ( j->second );
+            dchannels[channel].restore ( j->second );
             //fprintf (stderr, "(%d x %d)\n", dchannels[channel].xsize, dchannels[channel].ysize );
         }
     }
 
-    return dchannels3[channel];
+    return dchannels[channel];
 }
-
+/*
 inline NICE::MultiChannelImageT<int> & CachedExample::getIChannel ( int channel )
 {
   assert ( ( channel >= 0 ) && ( channel < I_NUMCHANNELS ) );
@@ -367,12 +367,12 @@ inline NICE::MultiChannelImageT<int> & CachedExample::getIChannel ( int channel
 
   return ichannels[channel];
 }
-
-inline NICE::MultiChannelImage3DT<int> & CachedExample::getIChannel3 ( int channel )
+*/
+inline NICE::MultiChannelImage3DT<int> & CachedExample::getIChannel ( int channel )
 {
     assert ( ( channel >= 0 ) && ( channel < I_NUMCHANNELS ) );
 
-    if ( ( ichannels3[channel].channels() == 0 ) )
+    if ( ( ichannels[channel].channels() == 0 ) )
     {
         if ( ( imgfn[0] != "" ) && ( channel == I_GRAYVALUES ) )
         {
@@ -394,14 +394,14 @@ inline NICE::MultiChannelImage3DT<int> & CachedExample::getIChannel3 ( int chann
             else
             {
                 //fprintf (stderr, "NICE::MultiChannelImageT: restoring data from %s\n", j->second.c_str() );
-                ichannels3[channel].restore ( j->second );
+                ichannels[channel].restore ( j->second );
             }
         }
     }
 
-    return ichannels3[channel];
+    return ichannels[channel];
 }
-
+/*
 inline NICE::MultiChannelImageT<long> & CachedExample::getLChannel ( int channel )
 {
   assert ( ( channel >= 0 ) && ( channel < L_NUMCHANNELS ) );
@@ -431,12 +431,12 @@ inline NICE::MultiChannelImageT<long> & CachedExample::getLChannel ( int channel
 
   return lchannels[channel];
 }
-
-inline NICE::MultiChannelImage3DT<long> & CachedExample::getLChannel3 ( int channel )
+*/
+inline NICE::MultiChannelImage3DT<long> & CachedExample::getLChannel ( int channel )
 {
     assert ( ( channel >= 0 ) && ( channel < L_NUMCHANNELS ) );
 
-    if ( lchannels3[channel].channels() == 0 )
+    if ( lchannels[channel].channels() == 0 )
     {
         std::map<int, std::string>::const_iterator j = ltemps.find ( channel );
         if ( j == ltemps.end() )
@@ -455,15 +455,15 @@ inline NICE::MultiChannelImage3DT<long> & CachedExample::getLChannel3 ( int chan
         else
         {
             //fprintf (stderr, "NICE::MultiChannelImageT: restoring data from %s\n", j->second.c_str() );
-            lchannels3[channel].restore ( j->second );
+            lchannels[channel].restore ( j->second );
         }
     }
 
-    return lchannels3[channel];
+    return lchannels[channel];
 }
 
 template<class ImgPixelValue>
-void CachedExample::dropImages ( NICE::MultiChannelImageT<ImgPixelValue> *images, std::map<int, std::string> & temps, int numImages )
+void CachedExample::dropImages ( NICE::MultiChannelImage3DT<ImgPixelValue> *images, std::map<int, std::string> & temps, int numImages )
 {
   for ( int i = 0 ; i < numImages; i++ )
   {

+ 4 - 4
cbaselib/progs/testCachedExample.cpp

@@ -53,14 +53,14 @@ int main ( int argc, char **argv )
     fprintf ( stderr, "Filename: %s\n", filename.c_str() );
     CachedExample ce ( filename );
 
-    NICE::MultiChannelImageT<int> & img = ce.getIChannel ( CachedExample::I_COLOR );
-    NICE::MultiChannelImageT<double> & imgc = ce.getDChannel ( CachedExample::D_INTEGRALCOLOR );
+    NICE::MultiChannelImage3DT<int> & img = ce.getIChannel ( CachedExample::I_COLOR );
+    NICE::MultiChannelImage3DT<double> & imgc = ce.getDChannel ( CachedExample::D_INTEGRALCOLOR );
 
     imgc.reInitFrom ( img );
     for ( uint j = 0 ; j < img.channels(); j++ )
     {
-      ImageT<double> tmp = imgc[j];
-      GenericImageTools::calcIntegralImage ( tmp, img[j], img.width(), img.height() );
+      ImageT<double> tmp = imgc.getChannelT(j);
+      GenericImageTools::calcIntegralImage ( tmp, img.getChannel(j), img.width(), img.height() );
     }
 
     Image visimg = imgc.getChannel ( 0 );

+ 2 - 2
features/fpfeatures/ColorHistogramFeature.cpp

@@ -39,8 +39,8 @@ ColorHistogramFeature::~ColorHistogramFeature()
 
 double ColorHistogramFeature::val ( const Example *example ) const
 {
-  const NICE::MultiChannelImageT<double> & img =
-    example->ce->getDChannel ( CachedExample::D_INTEGRALCOLOR );
+  const NICE::MultiChannelImage3DT<double> & img =
+  example->ce->getDChannel ( CachedExample::D_INTEGRALCOLOR );
   int tm_xsize = img.width();
   int tm_ysize = img.height();
 

+ 1 - 1
features/fpfeatures/ConvolutionFeature.cpp

@@ -146,7 +146,7 @@ void ConvolutionFeature::getFeatureVector(
         NICE::Vector & vec ) const
 {
     NICE::MultiChannelImage3DT<double> * imgD = NULL;
-    imgD = & example->ce->getDChannel3( CachedExample::D_EOH );
+    imgD = & example->ce->getDChannel( CachedExample::D_EOH );
     std::vector<double*> data = imgD->getDataPointer();
 
     int xsize, ysize, zsize;

+ 1 - 1
features/fpfeatures/EOHFeature.cpp

@@ -39,7 +39,7 @@ EOHFeature::~EOHFeature()
 
 double EOHFeature::val ( const Example *example ) const
 {
-  const NICE::MultiChannelImageT<double> & img = example->ce->getDChannel (
+  const NICE::MultiChannelImage3DT<double> & img = example->ce->getDChannel (
         CachedExample::D_INTEGRALEOH );
 
   int xsize;

+ 11 - 11
features/fpfeatures/FIGradients.cpp

@@ -17,29 +17,29 @@ void FIGradients::buildEOHMap ( CachedExample *ce,
   int xsize_s = xsize / subsamplex;
   int ysize_s = ysize / subsampley;
 
-  NICE::MultiChannelImageT<double> & eohimg = ce->getDChannel ( CachedExample::D_EOH );
-  eohimg.reInit ( xsize_s, ysize_s, numBins);
+  NICE::MultiChannelImage3DT<double> & eohimg = ce->getDChannel ( CachedExample::D_EOH );
+  eohimg.reInit ( xsize_s, ysize_s, 1, numBins);
 
   double *gradient = new double[xsize*ysize];
   int *dir = new int[xsize*ysize];
 
   if ( ce->colorInformationAvailable() ) {
-    NICE::MultiChannelImageT<int> & colorimg = ce->getIChannel ( CachedExample::I_COLOR );
-    int **data = colorimg.getDataPointer();
+    NICE::MultiChannelImage3DT<int> & colorimg = ce->getIChannel ( CachedExample::I_COLOR );
+    std::vector<int*> data = colorimg.getDataPointer();
     const int *r = data[0];
     const int *g = data[1];
     const int *b = data[2];
     FastFilter::calcColorGradient ( r, g, b, xsize, ysize,
                                     gradient, dir, numBins, usesigned );
   } else {
-    NICE::MultiChannelImageT<int> & grayvalues = ce->getIChannel ( CachedExample::I_GRAYVALUES );
-    int **data = grayvalues.getDataPointer();
+    NICE::MultiChannelImage3DT<int> & grayvalues = ce->getIChannel ( CachedExample::I_GRAYVALUES );
+    std::vector<int*> data = grayvalues.getDataPointer();
     const int *gr = data[0];
     FastFilter::calcGradient ( gr, xsize, ysize, gradient, dir, numBins, usesigned );
   }
 
   eohimg.setAll ( 0 );
-  double **data = eohimg.getDataPointer();
+  std::vector<double*> data = eohimg.getDataPointer();
   long korig = 0;
   for ( int y = 0 ; y < ysize ; y++ )
     for ( int x = 0 ; x < xsize ; x++, korig++ )
@@ -68,12 +68,12 @@ void FIGradients::buildEOHMap ( CachedExample *ce,
   delete [] gradient;
   delete [] dir;
 
-  NICE::MultiChannelImageT<double> & eohintimg = ce->getDChannel ( CachedExample::D_INTEGRALEOH );
-  eohintimg.reInit ( xsize_s, ysize_s, numBins );
+  NICE::MultiChannelImage3DT<double> & eohintimg = ce->getDChannel ( CachedExample::D_INTEGRALEOH );
+  eohintimg.reInit ( xsize_s, ysize_s, 1, numBins );
   for ( uint i = 0 ; i < ( uint ) numBins ; i++ )
   {
-    ImageT<double> tmpEohImg         = eohimg[i];
-    ImageT<double> tmpEohIntegralImg = eohintimg[i];
+    ImageT<double> tmpEohImg         = eohimg.getChannelT(i);
+    ImageT<double> tmpEohIntegralImg = eohintimg.getChannelT(i);
     GenericImageTools::calcIntegralImage ( tmpEohIntegralImg, tmpEohImg, xsize_s, ysize_s );
   }
 

+ 5 - 4
features/fpfeatures/FIHistograms.cpp

@@ -34,12 +34,13 @@ void FIHistograms::buildHSVMap (
     exit ( -1 );
   }
 
-  NICE::MultiChannelImageT<int> & colorimg = ce->getIChannel ( CachedExample::I_COLOR );
+  NICE::MultiChannelImage3DT<int> & colorimg = ce->getIChannel ( CachedExample::I_COLOR );
   assert ( colorimg.channels() == 3 );
 
   NICE::MultiChannelImageT<double> hsvimg ( xsize, ysize, colorimg.channels() );
 
-  ColorSpace::convert ( hsvimg, colorimg,
+  ColorSpace::convert ( hsvimg,
+                        colorimg.getColorMCI(0),
                         ColorSpace::COLORSPACE_HSL,
                         ColorSpace::COLORSPACE_RGB,
                         1.0, 255.0 );
@@ -68,8 +69,8 @@ void FIHistograms::buildHSVMap (
 
   hsvimg.freeData();
 
-  NICE::MultiChannelImageT<double> & colorhist = ce->getDChannel ( CachedExample::D_INTEGRALCOLOR );
-  colorhist.reInit ( xsize_s, ysize_s, numBins);
+  NICE::MultiChannelImage3DT<double> & colorhist = ce->getDChannel ( CachedExample::D_INTEGRALCOLOR );
+  colorhist.reInit ( xsize_s, ysize_s, 1, numBins);
   colorhist.setAll ( 0 );
 
   long korig = 0;

+ 4 - 4
features/fpfeatures/HOGFeature.cpp

@@ -39,7 +39,7 @@ HOGFeature::~HOGFeature()
 
 double HOGFeature::val ( const Example *example ) const
 {
-  const NICE::MultiChannelImageT<double> & img =
+  const NICE::MultiChannelImage3DT<double> & img =
     example->ce->getDChannel ( CachedExample::D_INTEGRALEOH );
   int tm_xsize = img.width();
   int tm_ysize = img.height();
@@ -52,12 +52,12 @@ double HOGFeature::val ( const Example *example ) const
 
   int wsx2, wsy2;
   int exwidth = example->width;
-  if ( exwidth == 0 ) 
+  if ( exwidth == 0 )
   {
     wsx2 = window_size_x * tm_xsize / ( 2 * xsize );
     wsy2 = window_size_y * tm_ysize / ( 2 * ysize );
-  } 
-  else 
+  }
+  else
   {
     int exheight = example->height;
     wsx2 = exwidth * tm_xsize / ( 2 * xsize );

+ 2 - 2
features/fpfeatures/HaarFeature.cpp

@@ -87,9 +87,9 @@ HaarFeature::~HaarFeature()
 
 double HaarFeature::val ( const Example *example ) const
 {
-  NICE::MultiChannelImageT<long> & img = example->ce->getLChannel ( CachedExample::L_INTEGRALIMAGE );
+  NICE::MultiChannelImage3DT<long> & img = example->ce->getLChannel ( CachedExample::L_INTEGRALIMAGE );
 
-  long **data = img.getDataPointer();
+  std::vector<long*> data = img.getDataPointer();
   const long *integralImage = data[0];
   int xsize = img.width();
   int ysize = img.height();

+ 1 - 1
features/fpfeatures/HistFeature.cpp

@@ -46,7 +46,7 @@ HistFeature::~HistFeature()
 
 double HistFeature::val ( const Example *example ) const
 {
-  const NICE::MultiChannelImageT<double> & img = example->ce->getDChannel ( histtype );
+  const NICE::MultiChannelImage3DT<double> & img = example->ce->getDChannel ( histtype );
   int tm_xsize = img.width();
   int tm_ysize = img.height();
 

+ 2 - 2
features/fpfeatures/PixelPairFeature.cpp

@@ -111,7 +111,7 @@ double PixelPairFeature::val ( const Example *example ) const
 {
   int xl = example->x;
   int yl = example->y;
-  NICE::MultiChannelImageT<int> & img = example->ce->getIChannel ( imagetype );
+  NICE::MultiChannelImage3DT<int> & img = example->ce->getIChannel ( imagetype );
 
   int xx1 = x1;
   int yy1 = y1;
@@ -139,7 +139,7 @@ double PixelPairFeature::val ( const Example *example ) const
   {
     int p2x = BOUND ( xl + xx2, 0, xsize - 1 );
     int p2y = BOUND ( yl + yy2, 0, ysize - 1 );
-    
+
     int v2 = img.get(p2x,p2y,b2);
 
     if ( type == PPTYPE_DIFF )

+ 1 - 1
features/fpfeatures/SemanticFeature.cpp

@@ -47,7 +47,7 @@ SemanticFeature::~SemanticFeature()
 
 double SemanticFeature::val ( const Example *example ) const
 {
-  const NICE::MultiChannelImageT<double> & img = example->ce->getDChannel (
+  const NICE::MultiChannelImage3DT<double> & img = example->ce->getDChannel (
         CachedExample::D_INTEGRALPRIOR );
 
   int xsize;