Browse Source

complete revision of SemSegContextTree

Sven Sickert 11 years ago
parent
commit
49bd8bbb0d

+ 0 - 34
image/MultiChannelImage3DT.cpp

@@ -1,34 +0,0 @@
-#include "core/image/MultiChannelImage3DT.h"
-
-using namespace NICE;
-
-#define SET_FUNCS_MACRO(MYTYPE) \
-  template <> \
-  int MultiChannelImage3DT<MYTYPE>::getPixelInt(int x, int y, int channel) const \
-  { \
-    return (int)get(x,y,channel); \
-  } \
-  \
-  template<>\
-  double MultiChannelImage3DT<MYTYPE>::getPixelFloat(int x, int y, int channel) const\
-  {\
-    return (double)get(x,y,channel);\
-  }\
-  template<>\
-  void MultiChannelImage3DT<MYTYPE>::setPixelInt(int x, int y, int channel, int pixel)\
-  {\
-    set(x,y,(MYTYPE)pixel,channel);\
-  }\
-  \
-  template<>\
-  void MultiChannelImage3DT<MYTYPE>::setPixelFloat(int x, int y, int channel, double pixel)\
-  {\
-    set(x,y,(MYTYPE)pixel,channel);\
-  }
-
-SET_FUNCS_MACRO ( int )
-SET_FUNCS_MACRO ( long int )
-SET_FUNCS_MACRO ( double )
-SET_FUNCS_MACRO ( float )
-SET_FUNCS_MACRO ( unsigned int )
-

+ 0 - 183
image/MultiChannelImage3DT.h

@@ -1,183 +0,0 @@
-#ifndef _NICE_CORE_MULTICHANNELIMAGE3DT_H
-#define _NICE_CORE_MULTICHANNELIMAGE3DT_H
-
-#include <semseg3d/image/MultiChannelImageAccess3D.h>
-#include <core/image/ImageT.h>
-#include <core/image/MultiChannelImageT.h>
-
-#include <vector>
-#include <fstream>
-
-namespace NICE {
-
-/**
- * @class MultiChannelImage3DT
- * A 3d image (arbitrary number of cross section images) consisting of an arbitrary number of channels.
- *
- * formaly known as Generic Image
- *
- * @author Erik Rodner and Björn Fröhlich and Sven Sickert
- * @example notyet
- */
-
-template <class P>
-class MultiChannelImage3DT : public MultiChannelImageAccess3D {
-protected:
-  typedef P Value;
-  typedef unsigned int uint;
-
-  /** image data, use carefully !!! data[channel][pixel_offset] */
-  P **data;
-  
-  /** image width */
-  int xsize;
-  
-  /** image height */
-  int ysize;
-
-  /** image depth */
-  int zsize;
-  
-  /** number of image channels */
-  uint numChannels;
-  
-public:
-
-  virtual inline int width() const;
-  virtual inline int height() const;
-  virtual inline int depth() const;
-
-  virtual inline int channels() const;
-
-  virtual int getPixelInt( int x, int y, int z, int channel ) const;
-
-  virtual double getPixelFloat( int x, int y, int z, int channel ) const;
-
-  virtual void setPixelInt( int x, int y, int z, int channel, int pixel );
-
-  virtual void setPixelFloat( int x, int y, int z, int channel, double pixel );
-
-  /** simple constructor */
-  MultiChannelImage3DT( int xsize, int ysize, int zsize, uint numChannels = 1);
-
-  /** very simple constructor */
-  MultiChannelImage3DT();
-
-  /** copy constructor */
-  MultiChannelImage3DT( const MultiChannelImage3DT<P>& p );
-
-  /** simple destructor */
-  virtual ~MultiChannelImage3DT();
-
-  /** free all memory */
-  void freeData();
-
-  /** reinit */
-  void reInit( int xsize, int ysize, int zsize, int numChannels = 1);
-
-  /** reinit data structure using the same dimensions and
-   number of channels as another image */
-  template<class SrcP>
-  void reInitFrom( const MultiChannelImage3DT<SrcP> & src);
-
-  void addChannel( int newChans = 1 );
-
-  /** add a channel to Multichannel Image */
-  template<class SrcP>
-  void addChannel( NICE::MultiChannelImageT<SrcP> &newImg );
-  
-  template<class SrcP>
-  void addChannel(const NICE::MultiChannelImage3DT<SrcP> &newImg);
-  
-  /** get value */
-  P get( int x, int y, int z, uint channel = 0 ) const;
-  
-  /** get data pointer */
-  P** getDataPointer();
-
-  /** set value */
-  void set( int x, int y, int z, P val, uint channel = 0 );
-
-  /** set value */
-  void set( P val, uint channel = 0 );
-
-  /** set value */
-  void setAll( P val );
-
-  /** calc integral image */
-  void calcIntegral( uint channel = 0 );
-  
-  /** 
-   * @brief calculate the gray level co-occurence matrix of a channel
-   * @param max Co-occurence Matrix
-   * @param dis displacement vector
-   * @param channel channel
-   */
-  void calcGLCM( std::vector<std::vector<double> > & mat, const std::vector<int> dis, uint channel = 0 );
-  
-  /** 
-   * @brief calculate the variance image map of a channel
-   * @param srcchan source channel with raw data
-   * @param tarchan target channel for the variance map
-   */
-  void calcVariance( uint srcchan = 0, uint tarchan = 1 );
-  
-  /**
-   * @brief calculate the integral value in the volume given by upper left front corner and lower right back corner, including out of boundary check
-   * @warning make sure that the given channel is an integral 3d image
-   * @param ulfx upper left front x coordinate
-   * @param ulfy upper left front y coordinate
-   * @param ulfz upper left front z coordinate
-   * @param lrbx lower right back x coordinate
-   * @param lrby lower right back y coordinate
-   * @param lrbz lower right back z coordinate
-   * @param channel channel
-   * @return P mean value of given volume
-   **/
-  P getIntegralValue(int ulfx, int ulfy, int ulfz, int lrbx, int lrby, int lrbz, int channel);
-
-  /** convert to ice image */
-  void convertToGrey( NICE::Image & img, int z, uint channel = 0, bool normalize = true ) const;
-
-	/** convert to ice image template */
-  void convertToGrey( NICE::ImageT<P> & img, int z, uint channel = 0, bool normalize = false ) const;
-	
-  /** convert to ice colorimage */
-  void convertToColor( NICE::ColorImage & img, int z, const int chan1 = 0, const int chan2 = 1, const int chan3 = 2 ) const;
-
-  /** return image for visualization */
-  Image getChannel( int z, uint channel = 0 ) const;
-
-	/** return image for visualization */
-  ImageT<P> getChannelT( int z, uint channel = 0 ) const;
-
-  /** return rgb image for visualization */
-  ColorImage getColor(int z) const;
-
-  /** calculate image statistics */
-  void statistics( P & min, P & max, uint channel = 0 ) const;
-
-  /** correct inhomogeneous illuminations (shading) between the image slices **/
-  void correctShading( uint channel = 0 ) const;
-  
-  /** dump all data to RAW format: xsize, ysize, numChannels, <data> */
-  void store( std::string filename ) const;
-
-  /** read all data from RAW format: xsize, ysize, numChannels, <data> */
-  void restore( std::string filename );
-  
-  /** copy alls data to new object */
-  MultiChannelImage3DT<P>& operator=( const MultiChannelImage3DT<P>& orig );
-  
-  /** element operator */
-  P & operator() (int x, int y, int z, uint channel = 0);
-  
-  /** element operator */
-  MultiChannelImageT<P> operator[] (uint c);
-};
-
-} // namespace
-
-#include <semseg3d/image/MultiChannelImage3DT.tcc>
-
-#endif

+ 0 - 915
image/MultiChannelImage3DT.tcc

@@ -1,915 +0,0 @@
-#include <iostream>
-#include <assert.h>
-#include <stdio.h>
-#include <vector>
-
-namespace NICE {
-template<class P>
-MultiChannelImage3DT<P>::MultiChannelImage3DT( int _xsize, int _ysize, int _zsize, uint _numChannels)
-{
-  data = NULL;
-  numChannels = 0;
-  xsize = 0;
-  ysize = 0;
-  zsize = 0;
-  reInit( _xsize, _ysize, _zsize, _numChannels);
-}
-
-template<class P>
-MultiChannelImage3DT<P>::MultiChannelImage3DT()
-{
-  xsize = 0;
-  ysize = 0;
-  zsize = 0;
-  numChannels = 0;
-  data = NULL;
-}
-
-template<class P>
-P & MultiChannelImage3DT<P>::operator() (int x, int y, int z, uint channel)
-{
-  assert( channel < numChannels );
-  assert(( x < xsize ) && ( x >= 0 ) );
-  assert(( y < ysize ) && ( y >= 0 ) );
-  assert(( z < zsize ) && ( z >= 0 ) );
-  assert( data[channel] != NULL );
-  return data[channel][x + y*xsize + z*xsize*ysize];
-}
-
-template<class P>
-MultiChannelImageT<P> MultiChannelImage3DT<P>::operator[] (uint c)
-{
-  // This was our first idea ... but it creates a real copy
-  // ImageT<P> tmp ( data[c], xsize, ysize, xsize*sizeof(P), GrayColorImageCommonImplementation::noAlignment );
-  // This is the correct version. The funny thing about this is that shallowCopy
-  // is not an enum parameter, but an instance of ShallowCopyMode, which is a class.
-  // This fancy trick was done in older to prevent automatic conversion between enum types
-  // as done implicitly by C++.
-  
-  MultiChannelImageT<P> img;
-  for( int z = 0; z < zsize; z++ )
-  {
-    P * datatmp = data[c];
-    ImageT<P> tmp ( &datatmp[z*(xsize*ysize)], xsize, ysize, xsize*sizeof(P), GrayColorImageCommonImplementation::shallowCopy );
-    img.addChannel(tmp);
-  }
-  return img;
-}
-
-template<class P>
-MultiChannelImage3DT<P>& MultiChannelImage3DT<P>::operator=(const MultiChannelImage3DT<P>& orig) 
-{
-  if(!(xsize == orig.xsize && ysize == orig.ysize && zsize == orig.zsize && numChannels == orig.numChannels))
-  {
-    freeData();
-    xsize = orig.xsize;
-    ysize = orig.ysize;
-    zsize = orig.zsize;
-    numChannels = orig.numChannels;
-    if(orig.data != NULL)
-    {
-      data = new P *[numChannels];
-      for ( int c = 0; c < ( int )numChannels; c++ )
-      {
-        if ( orig.data[c] == NULL )
-        {
-          data[c] = NULL;
-        }
-        else
-        {
-          data[c] = new P [xsize*ysize*zsize];
-        }
-      }
-    }
-    else
-      data = NULL;
-  }
-
-  for ( int c = 0; c < ( int )numChannels; c++ )
-  {
-    if ( orig.data[c] != NULL )
-    {
-      for ( int x = 0; x < xsize*ysize*zsize; x++ )
-      {
-        data[c][x] = orig.data[c][x];
-      }
-    }
-  }
-  
-  return *this;
-}
-
-template<class P>
-MultiChannelImage3DT<P>::MultiChannelImage3DT( const MultiChannelImage3DT<P>& p )
-{
-  data = NULL;
-  xsize = p.xsize;
-  ysize = p.ysize;
-  zsize = p.zsize;
-  numChannels = p.numChannels;
-   
-  if(p.data != NULL)
-    data = new P *[numChannels];
-  else
-    data = NULL;
-
-  for ( int c = 0; c < ( int )numChannels; c++ )
-  {
-    if ( p.data[c] == NULL )
-    {
-      data[c] = NULL;
-    }
-    else
-    {
-      data[c] = new P [xsize*ysize*zsize];
-      for ( int x = 0; x < xsize*ysize*zsize; x++ )
-      {
-        data[c][x] = p.data[c][x];
-      }
-    }
-  }
-}
-
-
-template<class P>
-void MultiChannelImage3DT<P>::addChannel( int newChans )
-{
-  P **tmpData = new P *[numChannels+newChans];
-
-  bool allocMem = false;
-  int i = 0;
-
-  for ( ; i < (int)numChannels; i++ )
-  {
-    tmpData[i] = data[i];
-
-    if ( data[i] != NULL )
-      allocMem = true;
-  }
-
-  if ( allocMem )
-  {
-    for ( ; i < newChans + (int)numChannels; i++ )
-    {
-      tmpData[i] = new P [xsize*ysize*zsize];
-    }
-  }
-
-  numChannels += newChans;
-
-  delete [] data;
-
-  data = new P *[numChannels];
-
-  for ( i = 0; i < (int)numChannels; i++ )
-  {
-    data[i] = tmpData[i];
-  }
-
-  delete [] tmpData;
-}
-
-template<class P>
-template<class SrcP>
-void MultiChannelImage3DT<P>::addChannel(NICE::MultiChannelImageT<SrcP> &newMCImg)
-{
-  int oldchan = numChannels;
-  if(this->xsize > 0)
-  {
-    assert(newMCImg.width() == this->width() && newMCImg.height() == this->height());
-    assert(newMCImg.channels() == this->zsize);
-    addChannel(1);
-  }
-  else
-  {
-    reInit( newMCImg.width(), newMCImg.height(), newMCImg.channels(), 1 );
-  }
-  
-  for(int z = 0; z < this->zsize; z++)
-  {
-    NICE::ImageT<SrcP> newImg = newMCImg[z];
-    for(int y = 0; y < this->ysize; y++)
-    {
-      for(int x = 0; x < this->xsize; x++)
-      {
-        data[oldchan][x + y*xsize + z*xsize*ysize] = (P)newImg(x,y);
-      }
-    }
-  }
-}
-
-template<class P>
-template<class SrcP>
-void MultiChannelImage3DT<P>::addChannel(const NICE::MultiChannelImage3DT<SrcP> &newImg)
-{
-  int oldchan = numChannels;
-  if(numChannels > 0)
-  {
-    assert(newImg.width() == this->width() && newImg.height() == this->height() && newImg.depth() == this->depth());
-    addChannel(newImg.channels());
-  }
-  else
-  {
-      reInit( newImg.width(), newImg.height(), newImg.depth(), newImg.channels() );
-  }
-  
-  int chanNI = 0;
-  
-  for(int c = oldchan; c < (int)numChannels; c++, chanNI++)
-  {
-    int val = 0;
-    for(int z = 0; z < this->zsize; z++)
-    {
-      for(int y = 0; y < this->ysize; y++)
-      {
-        for(int x = 0; x < this->xsize; x++, val++)
-        {
-          data[c][val] = newImg.get(x,y,z,chanNI);
-        }
-      }
-    }
-  }
-}
-
-template<class P>
-MultiChannelImage3DT<P>::~MultiChannelImage3DT()
-{
-  freeData();
-}
-
-template<class P>
-void MultiChannelImage3DT<P>::freeData()
-{
-  if ( data != NULL )
-  {
-    for ( uint i = 0 ; i < numChannels ; i++ )
-      if ( data[i] != NULL )
-        delete [] data[i];
-
-    delete [] data;
-
-    data = NULL;
-  }
-}
-
-template<class P>
-void MultiChannelImage3DT<P>::reInit( int _xsize, int _ysize, int _zsize, int _numChannels )
-{
-  freeData();
-  xsize = _xsize;
-  ysize = _ysize;
-  zsize = _zsize;
-  numChannels = _numChannels;
-  data = new P *[numChannels];
-
-  for ( uint i = 0 ; i < numChannels; i++ )
-    data[i] = new P [xsize*ysize*zsize];
-}
-
-template<class P>
-template<class SrcP>
-void MultiChannelImage3DT<P>::reInitFrom( const MultiChannelImage3DT<SrcP> & src )
-{
-  freeData();
-
-  xsize = src.width();
-  ysize = src.height();
-  zsize = src.depth();
-  numChannels = src.channels();
-
-  data = new P *[numChannels];
-
-  for ( uint i = 0 ; i < numChannels; i++ )
-    data[i] = new P [xsize*ysize*zsize];
-}
-
-template<class P>
-P MultiChannelImage3DT<P>::get( int x, int y, int z, uint channel ) const
-{
-  assert( channel < numChannels );
-  assert(( x < xsize ) && ( x >= 0 ) );
-  assert(( y < ysize ) && ( y >= 0 ) );
-  assert(( z < zsize ) && ( z >= 0 ) );
-  assert( data[channel] != NULL );
-
-  return data[channel][x + y*xsize + z*xsize*ysize];
-}
-
-template<class P>
-P ** MultiChannelImage3DT<P>::getDataPointer()
-{
-  return data;
-}
-
-template<class P>
-void MultiChannelImage3DT<P>::set( int x, int y, int z, P val, uint channel )
-{
-  assert( channel < numChannels );
-  assert(( x < xsize ) && ( x >= 0 ) );
-  assert(( y < ysize ) && ( y >= 0 ) );
-  assert(( z < zsize ) && ( z >= 0 ) );
-  assert( data[channel] != NULL );
-
-  data[channel][x + y*xsize + z*xsize*ysize] = val;
-}
-
-template<class P>
-void MultiChannelImage3DT<P>::set( P val, uint channel )
-{
-  assert( channel < numChannels );
-  assert( data[channel] != NULL );
-
-  for ( int k = 0 ; k < xsize*ysize*zsize ; k++ )
-    data[channel][k] = val;
-}
-
-template<class P>
-void MultiChannelImage3DT<P>::setAll( P val )
-{
-  for ( uint channel = 0 ; channel < numChannels ; channel++ )
-    if ( data[channel] != NULL )
-      set( val, channel );
-}
-
-template<class P>
-void MultiChannelImage3DT<P>::statistics( P & min, P & max, uint channel ) const
-{
-  assert( channel < numChannels );
-
-  for ( long k = 0 ; k < xsize*ysize*zsize ; k++ )
-  {
-    P val = data [channel][k];
-    if (( k == 0 ) || ( val > max ) ) max = val;
-    if (( k == 0 ) || ( val < min ) ) min = val;
-  }
-  
-  assert(finite(max));
-  assert(finite(min));
-}
-
-template<class P>
-void MultiChannelImage3DT<P>::correctShading( uint channel ) const
-{
-  assert( channel < numChannels );
-  
-  std::vector<double> meanVals;
-  for( int z = 0; z < zsize; z++ )
-  {
-    double sumVal = 0;
-    for( int y = 0; y < ysize; y++ )
-    {
-      for( int x = 0; x < xsize; x++ )
-      {
-        sumVal += data [channel][x + y*xsize + z*xsize*ysize];
-      }
-    }
-    sumVal /= (xsize*ysize);
-    meanVals.push_back( sumVal );
-  }
-
-  P newMax = std::numeric_limits<P>::min();
-  short int maxVal = 255;
-  for ( int z = 0; z < zsize; z++ )
-  {
-    for ( int y = 0; y < ysize; y++ )
-    {
-      for ( int x = 0; x < xsize; x++ )
-      {
-        P tmp = data [channel][x + y*xsize + z*xsize*ysize];
-        double newVal = maxVal * ( (double) tmp / (double) meanVals[z] );
-        if ( ( P ) newVal > newMax )
-          newMax = ( P ) newVal;
-        data [channel][x + y*xsize + z*xsize*ysize] = newVal;
-      }
-    }
-  }
-}
-
-template<class P>
-Image MultiChannelImage3DT<P>::getChannel( int z, uint channel ) const
-{
-  assert( channel < numChannels );
-
-  NICE::Image img;
-  convertToGrey( img, z, channel, true );
-
-  return img;
-}
-
-template<class P>
-ImageT<P> MultiChannelImage3DT<P>::getChannelT( int z, uint channel ) const
-{
-  assert( channel < numChannels );
-
-  NICE::ImageT<P> img;
-  convertToGrey( img, z, channel, false );
-  
-  P min, max;
-  statistics ( min, max, channel );
-  fprintf (stderr, "MultiChannelImage3DT<>::showChannel: max %f min %f\n", (double)max, (double)min );
-
-  return img;
-}
-
-/** convert to ice image */
-template<class P>
-void MultiChannelImage3DT<P>::convertToGrey( NICE::Image & img, int z, uint channel,  bool normalize ) const
-{
-  assert( channel < numChannels );
-
-  P min, max;
-
-  if ( normalize ) {
-    statistics( min, max, channel );
-    fprintf( stderr, "MultiChannelImage3DT<>::showChannel: max %f min %f\n", ( double )max, ( double )min );
-  }
-
-  bool skip_assignment = false;
-
-  img.resize( xsize, ysize );
-
-  if ( normalize )
-    if ( max - min < std::numeric_limits<double>::min() )
-    {
-      img.set( max );
-      skip_assignment = true;
-      fprintf( stderr, "MultiChannelImage3DT::showChannel: image is uniform! (%f)\n", ( double )max );
-    }
-
-
-  if ( ! skip_assignment )
-  {
-    long k = 0;
-
-    for ( int y = 0 ; y < ysize; y++ )
-    {
-      for ( int x = 0 ; x < xsize ; x++, k++ )
-      {
-        if ( normalize )
-        {
-          img.setPixel( x, y, ( int )(( data[channel][z*xsize*ysize + k] - min ) * 255 / ( max - min ) ) );
-        }
-        else
-        {
-          img.setPixel( x, y, ( int )( data[channel][z*xsize*ysize + k] ) );
-        }
-      }
-    }
-  }
-}
-
-/** convert to ice image template */
-template<class P>
-void MultiChannelImage3DT<P>::convertToGrey( NICE::ImageT<P> & img, int z, uint channel,  bool normalize ) const
-{
-  assert( channel < numChannels );
-
-  P min, max;
-
-  if ( normalize ) {
-    statistics( min, max, channel );
-    fprintf( stderr, "MultiChannelImage3DT<>::showChannel: max %f min %f\n", ( double )max, ( double )min );
-  }
-
-  bool skip_assignment = false;
-
-  img.resize( xsize, ysize );
-
-  if ( normalize )
-    if ( max - min < std::numeric_limits<double>::min() )
-    {
-      img.set( max );
-      skip_assignment = true;
-      fprintf( stderr, "MultiChannelImage3DT::showChannel: image is uniform! (%f)\n", ( double )max );
-    }
-
-
-  if ( ! skip_assignment )
-  {
-    long k = 0;
-
-    for ( int y = 0 ; y < ysize; y++ )
-    {
-      for ( int x = 0 ; x < xsize ; x++, k++ )
-      {
-        if ( normalize )
-        {
-          img.setPixel( x, y, ( int )(( data[channel][z*xsize*ysize + k] - min ) * 255 / ( max - min ) ) );
-        }
-        else
-        {
-          img.setPixel( x, y, ( int )( data[channel][z*xsize*ysize + k] ) );
-        }
-      }
-    }
-  }
-}
-
-template<class P>
-void MultiChannelImage3DT<P>::convertToColor( NICE::ColorImage & img, int z, const int chan1, const int chan2, const int chan3) const
-{
-  assert( chan1 < numChannels && chan2 < numChannels && chan3 < numChannels);
-
-  img.resize( xsize, ysize );
-
-  long k = 0;
-
-  for ( int y = 0 ; y < ysize; y++ )
-  {
-    for ( int x = 0 ; x < xsize ; x++, k++ )
-    {
-      img.setPixel( x, y, 0, ( int )( data[chan1][z*xsize*ysize + k] ) );
-      img.setPixel( x, y, 1, ( int )( data[chan2][z*xsize*ysize + k] ) );
-      img.setPixel( x, y, 2, ( int )( data[chan3][z*xsize*ysize + k] ) );
-    }
-  }
-}
-
-template<class P>
-ColorImage MultiChannelImage3DT<P>::getColor(int z) const
-{
-  assert( z < zsize );
-	assert( numChannels >= 3 );
-
-  NICE::ColorImage img( xsize, ysize );
-
-  long k = 0;
-
-  for ( int y = 0 ; y < ysize; y++ )
-  {
-    for ( int x = 0 ; x < xsize ; x++, k++ )
-    {
-      img.setPixel( x, y, 0, ( int )( data[0][z*xsize*ysize + k] ) );
-      img.setPixel( x, y, 1, ( int )( data[1][z*xsize*ysize + k] ) );
-      img.setPixel( x, y, 2, ( int )( data[2][z*xsize*ysize + k] ) );
-    }
-  }
-  //showImage(img);
-  //getchar();
-  return img;
-}
-
-template<class P>
-void MultiChannelImage3DT<P>::calcIntegral( uint channel )
-{
-  assert( channel < numChannels );
-  assert( data[channel] != NULL );
-
-  P *integralImage = data[channel];
-
-  /** first column **/
-  int k = xsize;
-  for ( int y = 1 ; y < ysize; y++, k += xsize )
-    integralImage[k] += integralImage[k-xsize];
-
-  /** first row **/
-  k = 1;
-  for ( int x = 1 ; x < xsize; x++, k++ )
-    integralImage[k] += integralImage[k-1];
-
-  /** first stack (depth) **/
-  k = xsize * ysize;
-  for ( int z = 1 ; z < zsize; z++, k += (xsize*ysize) )
-  integralImage[k] += integralImage[k-(xsize*ysize)];
-
-  /** x-y plane **/
-  k = xsize + 1;
-  for ( int y = 1 ; y < ysize ; y++, k++ )
-    for ( int x = 1 ; x < xsize ; x++, k++ )
-    {
-      integralImage[k] += integralImage[k-1];
-      integralImage[k] += integralImage[k - xsize];
-      integralImage[k] -= integralImage[k - xsize - 1];
-    }
-
-  /** y-z plane **/
-  k = xsize*ysize + xsize;
-  for ( int z = 1 ; z < zsize ; z++, k+=xsize )
-    for ( int y = 1 ; y < zsize ; y++, k+=xsize )
-    {
-      integralImage[k] += integralImage[k-(xsize*ysize)];
-      integralImage[k] += integralImage[k - xsize];
-      integralImage[k] -= integralImage[k - xsize - (xsize*ysize)];
-    }
-  
-  /** x-z plane **/
-  k = xsize*ysize + 1;
-  for ( int z = 1 ; z < zsize ; z++, k+=((xsize*ysize)-(xsize-1)) )
-    for ( int x = 1 ; x < xsize ; x++, k++ )
-    {
-      integralImage[k] += integralImage[k-1];
-      integralImage[k] += integralImage[k - (xsize*ysize)];
-      integralImage[k] -= integralImage[k - (xsize*ysize) - 1];
-    }
-    
-  /** all other pixels **/
-  k = xsize*ysize + xsize + 1;
-  for ( int z = 1 ; z < zsize ; z++, k+= xsize )
-  {
-    for ( int y = 1 ; y < ysize ; y++, k++ )
-    {
-      for ( int x = 1 ; x < xsize ; x++, k++ )
-      {
-        integralImage[k] += integralImage[k - (xsize*ysize)];
-        integralImage[k] += integralImage[k - xsize];
-        integralImage[k] += integralImage[k - 1];
-        integralImage[k] += integralImage[k - (xsize*ysize) - xsize - 1];
-        integralImage[k] -= integralImage[k - (xsize*ysize) - xsize];
-        integralImage[k] -= integralImage[k - (xsize*ysize) - 1];
-        integralImage[k] -= integralImage[k - xsize - 1];
-      }
-    }
-  }
-}
-
-template<class P>
-void MultiChannelImage3DT<P>::calcGLCM( std::vector<std::vector<double> > & mat, const std::vector<int> dis, uint channel )
-{
-  assert( channel < numChannels );
-  assert( data[channel] != NULL );
-  assert( dis.size() > 2 );
-  
-  P min, max;
-  statistics( min, max, channel );
-  
-  long k = 0;
-
-  mat = std::vector<std::vector<double> > ( max+1, std::vector<double> ( max+1, 0.0 ) );
-  
-  for (int z = 0; z < zsize; z++ )
-  {
-    for (int y = 0; y < ysize; y++ )
-    {
-      for (int x = 0; x < xsize; x++)
-      {
-        if ( (x+dis[0]>=0) && (x+dis[0]<xsize)
-          && (y+dis[1]>=0) && (y+dis[1]<ysize)
-          && (z+dis[2]>=0) && (z+dis[2]<zsize) )
-        {
-          P val = get( x, y, z, channel );
-          P dval = get( x+dis[0], y+dis[1], z+dis[2], channel );
-          mat[val][dval]++;
-          mat[dval][val]++;   // symmetry
-          k += 2;
-        }
-      }
-    }
-  }
-  
-  for (int i = 0; i <= max; i++)
-  {
-    for (int j = 0; j <= max; j++)
-    {
-      mat[i][j] /= k;
-    }
-  }
-
-}
-
-template<class P>
-void MultiChannelImage3DT<P>::calcVariance( uint srcchan, uint tarchan )
-{
-  assert( srcchan < tarchan );
-  assert( tarchan < numChannels );
-  assert( data[srcchan] != NULL );
-  assert( data[tarchan] != NULL );
-  
-  uint windowsize = 3;
-  int win = (windowsize-1)/2;
-  
-  for ( int z = 0; z < zsize; z++ )
-  {
-    for ( int y = 0; y < ysize; y++ )
-    {
-      for ( int x = 0; x < xsize; x++ )
-      {
-        int meansum = 0;
-          for ( int u = -win; u <= win; u++ ) 
-          {
-            for ( int v = -win; v <= win; v++ )
-            {
-              for ( int w = -win; w <= win; w++)
-              {
-                int u_tmp = u;
-                int v_tmp = v;
-                int w_tmp = w;
-                if ( (x+u<0) || (x+u>=xsize) )
-                  u_tmp = -u_tmp;
-                if ( (y+v<0) || (y+v>=ysize) )
-                  v_tmp = -v_tmp;
-                if ( (z+w<0) || (z+w>=zsize) )
-                  w_tmp = -w_tmp;
-                meansum += get( x+u_tmp, y+v_tmp, z+w_tmp, srcchan );
-              }
-            }
-          }
-        meansum /= (windowsize*windowsize*windowsize);
-        
-        unsigned long varsum = 0;
-        for ( int u = -win; u <= win; u++ ) 
-        {
-          for ( int v = -win; v <= win; v++ )
-          {
-            for ( int w = -win; w <= win; w++)
-            {
-              int u_tmp = u;
-              int v_tmp = v;
-              int w_tmp = w;
-              if ( (x+u<0) || (x+u>=xsize) )
-                u_tmp = -u_tmp;
-              if ( (y+v<0) || (y+v>=ysize) )
-                v_tmp = -v_tmp;
-              if ( (z+w<0) || (z+w>=zsize) )
-                  w_tmp = -w_tmp;
-              
-              long sdev = (get( x+u_tmp, y+v_tmp, z+w_tmp, srcchan ) - meansum );
-              varsum += (sdev*sdev);
-            }
-          }
-        }
-        varsum /= (windowsize*windowsize+windowsize)-1;
-        set( x, y, z, varsum, tarchan );
-      }
-    }
-  }
-}
-
-template<class P>
-P MultiChannelImage3DT<P>::getIntegralValue(int ulfx, int ulfy, int ulfz, int lrbx, int lrby, int lrbz, int channel)
-{
-  ulfx = std::max(ulfx-1, -1);
-  ulfx = std::min(ulfx, xsize-1);
-  ulfy = std::max(ulfy-1, -1);
-  ulfy = std::min(ulfy, ysize-1);
-  ulfz = std::max(ulfz-1, -1);
-  ulfz = std::min(ulfz, zsize-1);
-
-  lrbx = std::max(lrbx, 0);
-  lrbx = std::min(lrbx, xsize-1);
-  lrby = std::max(lrby, 0);
-  lrby = std::min(lrby, ysize-1);
-  lrbz = std::max(lrbz, 0);
-  lrbz = std::min(lrbz, zsize-1);
-  
-  P val1, val2, val3, val4, val5, val6, val7, val8;
-  val1 = get(lrbx, lrby, lrbz, channel);
-  if( ulfz > -1 )
-    val2 = get(lrbx, lrby, ulfz, channel);
-  else
-    val2 = 0;
-  if( ulfx > -1 )
-    val3 = get(ulfx, lrby, lrbz, channel);
-  else
-    val3 = 0;
-  if( ulfx > -1 && ulfz > -1 )
-    val4 = get(ulfx, lrby, ulfz, channel);
-  else
-    val4 = 0;
-  if( ulfy > -1 )
-    val5 = get(lrbx, ulfy, lrbz, channel);
-  else
-    val5 = 0;
-  if( ulfy > -1 && ulfz > -1 )
-    val6 = get(lrbx, ulfy, ulfz, channel);
-  else
-    val6 = 0;
-  if( ulfx > -1 && ulfy > -1 )
-    val7 = get(ulfx, ulfy, lrbz, channel);
-  else
-    val7 = 0;
-  if(ulfx > -1 && ulfy > -1 && ulfz > -1)
-    val8 = get(ulfx, ulfy, ulfz, channel);
-  else
-    val8 = 0;
-  
-  P volume = abs((P)(lrbx-ulfx)*(lrby-ulfy)*(lrbz-ulfz));
-  P val = val1 - val2 - val3 + val4 - ( val5 - val6 - val7 + val8 );
-  return val/volume;
-}
-
-template<class P>
-void MultiChannelImage3DT<P>::store( std::string filename ) const
-{
-  // simple raw format
-  FILE *f = fopen( filename.c_str(), "w" );
-
-  if ( f == NULL ) {
-    fprintf( stderr, "MultiChannelImage3DT::store: error writing to %s\n", filename.c_str() );
-    exit( -1 );
-  }
-
-  fwrite( &xsize, sizeof( int ), 1, f );
-  fwrite( &ysize, sizeof( int ), 1, f );
-  fwrite( &zsize, sizeof( int ), 1, f );
-  fwrite( &numChannels, sizeof( uint ), 1, f );
-
-  for ( uint channel = 0 ; channel < numChannels ; channel++ )
-  {
-    assert( data[channel] != NULL );
-    fwrite( data[channel], sizeof( P ), xsize*ysize*zsize, f );
-  }
-
-  fclose( f );
-}
-
-template<class P>
-void MultiChannelImage3DT<P>::restore( std::string filename )
-{
-  // simple raw format
-  FILE *f = fopen( filename.c_str(), "r" );
-
-  if ( f == NULL ) {
-    fprintf( stderr, "MultiChannelImage3DT::store: error reading from %s\n", filename.c_str() );
-    exit( -1 );
-  }
-
-  fread( &xsize, sizeof( int ), 1, f );
-  fread( &ysize, sizeof( int ), 1, f );
-  fread( &zsize, sizeof( int ), 1, f );
-  fread( &numChannels, sizeof( uint ), 1, f );
-
-  if ( numChannels > 0 ) {
-    reInit( xsize, ysize, zsize, numChannels );
-
-    for ( uint channel = 0 ; channel < numChannels ; channel++ )
-    {
-      assert( data[channel] != NULL );
-      fread( data[channel], sizeof( P ), xsize*ysize*zsize, f );
-    }
-  } else {
-    freeData();
-    data = NULL;
-  }
-
-  fclose( f );
-}
-
-template<class P>
-int MultiChannelImage3DT<P>::width() const
-{
-  return xsize;
-}
-
-template<class P>
-int MultiChannelImage3DT<P>::height() const
-{
-  return ysize;
-}
-
-template<class P>
-int MultiChannelImage3DT<P>::depth() const
-{
-  return zsize;
-}
-
-template<class P>
-int MultiChannelImage3DT<P>::channels() const
-{
-  return ( int )numChannels;
-}
-
-template<class P>
-int MultiChannelImage3DT<P>::getPixelInt( int x, int y, int z, int channel ) const
-{
-  throw( "this type is not implemented\n" );
-  return -1;
-}
-
-template<class P>
-double MultiChannelImage3DT<P>::getPixelFloat( int x, int y, int z, int channel ) const
-{
-  throw( "this type is not implemented\n" );
-  return -1.0;
-}
-
-template<class P>
-void MultiChannelImage3DT<P>::setPixelInt( int x, int y, int z, int channel, int pixel )
-{
-  throw( "this type is not implemented\n" );
-}
-
-template<class P>
-void MultiChannelImage3DT<P>::setPixelFloat( int x, int y, int z, int channel, double pixel )
-{
-  throw( "this type is not implemented\n" );
-}
-/*
-#define SET_FUNCS_PROTO_MACRO(MYTYPE) \
-template<>\
-int MultiChannelImage3DT<MYTYPE>::getPixelInt(int x, int y, int channel) const;\
-template<>\
-double MultiChannelImage3DT<MYTYPE>::getPixelFloat(int x, int y, int channel) const;\
-template<>\
-void MultiChannelImage3DT<MYTYPE>::setPixelInt(int x, int y, int channel, int pixel);\
-template<>\
-void MultiChannelImage3DT<MYTYPE>::setPixelFloat(int x, int y, int channel, double pixel);
-
-SET_FUNCS_PROTO_MACRO( double )
-SET_FUNCS_PROTO_MACRO( int )
-SET_FUNCS_PROTO_MACRO( long int )
-SET_FUNCS_PROTO_MACRO( float )
-SET_FUNCS_PROTO_MACRO( unsigned int )
-*/
-} // namespace
-
-

+ 0 - 35
image/MultiChannelImageAccess3D.h

@@ -1,35 +0,0 @@
-/*
- * NICE-Core - efficient algebra and computer vision methods
- *  - libimage - An image library
- * See file License for license information.
- */
-
-#ifndef _LIMUN_BASEMULTICHANNELIMAGE3D_H
-#define _LIMUN_BASEMULTICHANNELIMAGE3D_H
-
-namespace NICE {
-
-/**
- * A generic, but not very efficient multi channel image access interface.
- *
- * @author Ferid Bajramovic
- */
-class MultiChannelImageAccess3D {
-public:
-  virtual int width() const = 0;
-  virtual int height() const = 0;
-	virtual int depth() const = 0;
-  virtual int channels() const = 0;
-
-  virtual int getPixelInt(int x, int y, int z, int channel) const = 0;
-  virtual double getPixelFloat(int x, int y, int z, int channel) const = 0;
-
-  virtual void setPixelInt(int x, int y, int z, int channel, int pixel) = 0;
-  virtual void setPixelFloat(int x, int y, int z, int channel, double pixel) = 0;
-
-  virtual ~MultiChannelImageAccess3D () {};
-};
-
-} // namespace
-
-#endif

+ 159 - 149
progs/testSemanticSegmentation.cpp

@@ -2,8 +2,8 @@
 
 /**
 * @file testSemanticSegmentation.cpp
-* @brief test semantic segmentation routines
-* @author Erik Rodner
+* @brief test semantic segmentation routines for 3d images and 2d images
+* @author Erik Rodner and Björn Fröhlich and Sven Sickert
 * @date 03/20/2008
 */
 
@@ -15,7 +15,7 @@
 #include "core/basics/StringTools.h"
 #include <vislearning/baselib/ICETools.h>
 
-#include <semseg3d/image/MultiChannelImage3DT.h>
+#include <core/image/MultiChannelImage3DT.h>
 #include <semseg3d/semseg/SemanticSegmentation.h>
 #include <semseg3d/semseg/SemSegContextTree.h>
 
@@ -30,6 +30,52 @@ using namespace NICE;
 
 using namespace std;
 
+void segmentToOverlay ( const NICE::Image *orig, const NICE::ColorImage & segment,
+                        NICE::ColorImage & result )
+{
+  int xsize = orig->width();
+  int ysize = orig->height();
+  
+  result.resize( xsize, ysize );
+  vector< NICE::MatrixT<double> > channelMat;
+  
+  double alpha = .5;
+  
+  for (int c = 0; c < 3; c++)
+  {
+    NICE::MatrixT<double> chan ( xsize, ysize );
+    channelMat.push_back( chan );
+  }
+
+  for (int y = 0; y < ysize; y++)
+  {
+    for (int x = 0; x < xsize; x++)
+    {
+      uchar val = orig->getPixelQuick(x,y);
+      for (int c = 0; c < 3; c++)
+        channelMat[c](x,y) = (double)val + alpha*(double)segment.getPixel( x, y, c );
+    }
+  }
+  
+  for (int c = 0; c < 3; c++)
+  {
+    channelMat[c] /= channelMat[c].Max();
+    channelMat[c] *= 255;
+  }
+  
+  for (int y = 0; y < ysize; y++)
+  {
+    for (int x = 0; x < xsize; x++)
+    {
+      for (int c = 0; c < 3; c++)
+      {
+        int val = channelMat[c](x,y);
+        result.setPixel( x, y, c, (uchar)val);
+      }
+    }
+  }
+}
+
 void updateMatrix ( const NICE::Image & img, const NICE::Image & gt,
                     NICE::Matrix & M, const set<int> & forbidden_classes )
 {
@@ -75,7 +121,6 @@ int main ( int argc, char **argv )
   /*-------------I/O CONFIGURATION-------------*/
   bool show_result = conf.gB ( "debug", "show_results", false );
   bool write_results = conf.gB ( "debug", "write_results", false );
-  bool write_results_pascal = conf.gB ( "debug", "write_results_pascal", false );
   bool run_3dseg = conf.gB ( "debug", "run_3dseg", true );
   string output_type = conf.gS ( "debug", "output_type", "ppm" );
   string output_postfix = conf.gS ( "debug", "output_postfix", "" );
@@ -91,21 +136,22 @@ int main ( int argc, char **argv )
 
   const ClassNames & classNames = md.getClassNames ( "train" );
 
+  // initialize semantic segmentation method
   SemanticSegmentation *semseg = NULL;
   semseg = new SemSegContextTree ( &conf, &md );
+  
+  // train semantic segmentation method
+  semseg->train( &md );
+  
   const LabeledSet *testFiles = md["test"];
 
   set<int> forbidden_classes;
-
   std::string forbidden_classes_s = conf.gS ( "analysis", "forbidden_classes", "" );
 
   classNames.getSelection ( forbidden_classes_s, forbidden_classes );
 
-  ProgressBar pb ( "Semantic Segmentation Analysis" );
-
-  pb.show();
-
-  int fileno = 0, imageno = 0;
+//   ProgressBar pb ( "Semantic Segmentation Analysis" );
+//   pb.show();
 
   vector< int > zsizeVec;
   semseg->getDepthVector ( testFiles, zsizeVec );
@@ -116,82 +162,109 @@ int main ( int argc, char **argv )
   NICE::MultiChannelImageT<double> gt;
   std::vector< NICE::Matrix > M_vec;
 
-  LOOP_ALL_S ( *testFiles )
+  for (LabeledSet::const_iterator it = testFiles->begin(); it != testFiles->end(); it++)
   {
-    EACH_INFO ( classno, info );
-    std::string file = info.img();
-    filelist.push_back ( file );
-    depthCount++;
-
-    NICE::Image lm;
-    NICE::Image lm_gt;
-    if ( info.hasLocalizationInfo() )
+    for (std::vector<ImageInfo *>::const_iterator jt = it->second.begin();
+         jt != it->second.end(); jt++)
     {
-      const LocalizationResult *l_gt = info.localization();
+      ImageInfo & info = *(*jt);
+      std::string file = info.img();
+      filelist.push_back ( file );
+      depthCount++;
+
+      NICE::Image lm;
+      NICE::Image lm_gt;
+      if ( info.hasLocalizationInfo() )
+      {
+        const LocalizationResult *l_gt = info.localization();
 
-      lm.resize ( l_gt->xsize, l_gt->ysize );
-      lm.set ( 0 );
+        lm.resize ( l_gt->xsize, l_gt->ysize );
+        lm.set ( 0 );
 
-      lm_gt.resize ( l_gt->xsize, l_gt->ysize );
-      lm_gt.set ( 0 );
+        lm_gt.resize ( l_gt->xsize, l_gt->ysize );
+        lm_gt.set ( 0 );
 
-      l_gt->calcLabeledImage ( lm, classNames.getBackgroundClass() );
-      fprintf ( stderr, "testSemanticSegmentation: Generating Labeled NICE::Image (Ground-Truth)\n" );
-      l_gt->calcLabeledImage ( lm_gt, classNames.getBackgroundClass() );
-    }
-    segresult.addChannel ( lm );
-    gt.addChannel ( lm_gt );
-
-    int depthBoundary = 0;
-    if ( run_3dseg )
-    {
-      depthBoundary = zsizeVec[idx];
-    }
+        l_gt->calcLabeledImage ( lm, classNames.getBackgroundClass() );
+        fprintf ( stderr, "testSemanticSegmentation: Generating Labeled NICE::Image (Ground-Truth)\n" );
+        l_gt->calcLabeledImage ( lm_gt, classNames.getBackgroundClass() );
+      }
+      segresult.addChannel ( lm );
+      gt.addChannel ( lm_gt );
 
-    if ( depthCount < depthBoundary ) continue;
+      int depthBoundary = 0;
+      if ( run_3dseg )
+      {
+        depthBoundary = zsizeVec[idx];
+      }
 
-    NICE::MultiChannelImage3DT<double> probabilities;
-    NICE::MultiChannelImage3DT<double> imgData;
-    semseg->make3DImage ( filelist, imgData );
-    cout << segresult.width() << " " << segresult.height() << " " << segresult.channels() << endl;
-    semseg->semanticseg ( imgData, segresult, probabilities, filelist );
+      if ( depthCount < depthBoundary ) continue;
 
-    fprintf ( stderr, "testSemanticSegmentation: Segmentation finished !\n" );
+      NICE::MultiChannelImage3DT<double> probabilities;
+      NICE::MultiChannelImage3DT<double> imgData;
+      semseg->make3DImage ( filelist, imgData );
+      semseg->classify ( imgData, segresult, probabilities, filelist );
 
-    // save to file
-    for ( int z = 0; z < segresult.channels(); z++ )
-    {
-      std::string fname = StringTools::baseName ( filelist[z], false );
+      fprintf ( stderr, "testSemanticSegmentation: Segmentation finished !\n" );
 
-      if ( write_results_pascal )
+      // save to file
+      for ( int z = 0; z < segresult.channels(); z++ )
       {
-        NICE::Image pascal_lm ( segresult.width(), segresult.height() );
-        int backgroundClass = classNames.getBackgroundClass();
+        std::string fname = StringTools::baseName ( filelist[z], false );
 
-        for ( int y = 0 ; y < segresult.height(); y++ )
+        if ( show_result || write_results )
         {
-          for ( int x = 0 ; x < segresult.width(); x++ )
+          NICE::ColorImage orig ( filelist[z] );
+          NICE::ColorImage rgb;
+          NICE::ColorImage rgb_gt;
+          NICE::ColorImage ov_rgb;
+          NICE::ColorImage ov_rgb_gt;
+
+          for ( int y = 0 ; y < segresult.height(); y++ )
           {
-            int v = segresult.get ( x, y, ( uint ) z );
+            for ( int x = 0 ; x < segresult.width(); x++ )
+            {
+              lm.setPixel ( x, y, segresult.get ( x, y, ( uint ) z ) );
+              if ( run_3dseg )
+                lm_gt.setPixel ( x, y, gt.get ( x, y, ( uint ) z ) );
+            }
+          }
+
+          classNames.labelToRGB ( lm, rgb );
+          classNames.labelToRGB ( lm_gt, rgb_gt );
 
-            if ( v == backgroundClass )
-              pascal_lm.setPixel ( x, y, 255 );
+          segmentToOverlay ( orig.getChannel(1), rgb, ov_rgb );
+          segmentToOverlay ( orig.getChannel(1), rgb_gt, ov_rgb_gt );
+          
+          if ( write_results )
+          {
+            std::stringstream out;       
+            if ( output_postfix.size() > 0 )
+              out << resultdir << "/" << fname << output_postfix;
             else
-              pascal_lm.setPixel ( x, y, 255 - v - 1 );
+              out << resultdir << "/" << fname;
+            
+            cerr << "Writing to file " << out.str() << "_*." << output_type << endl;
+            orig.write ( out.str() + "_orig." + output_type );
+            rgb.write ( out.str() + "_result." + output_type );
+            rgb_gt.write ( out.str() + "_groundtruth." + output_type );
+            ov_rgb.write ( out.str() + "_overlay_res." + output_type );
+            ov_rgb_gt.write ( out.str() + "_overlay_gt." + output_type );
           }
-        }
 
-        char filename[1024];
-        sprintf ( filename, "%s/%s.%s.%s", resultdir.c_str(), fname.c_str(), output_postfix.c_str(), output_type.c_str() );
-        pascal_lm.write ( filename );
+          if ( show_result )
+          {
+#ifndef NOVISUAL
+            showImage ( ov_rgb, "Result" );
+            showImage ( ov_rgb_gt, "Groundtruth" );
+            showImage ( orig, "Input" );
+#endif
+          }
+        }
       }
 
-      if ( show_result || write_results )
+//#pragma omp critical
+      for ( int z = 0; z < segresult.channels(); z++ )
       {
-        NICE::ColorImage orig ( filelist[z] );
-        NICE::ColorImage rgb;
-        NICE::ColorImage rgb_gt;
-
         for ( int y = 0 ; y < segresult.height(); y++ )
         {
           for ( int x = 0 ; x < segresult.width(); x++ )
@@ -201,69 +274,24 @@ int main ( int argc, char **argv )
               lm_gt.setPixel ( x, y, gt.get ( x, y, ( uint ) z ) );
           }
         }
-
-        classNames.labelToRGB ( lm, rgb );
-        classNames.labelToRGB ( lm_gt, rgb_gt );
-
-        if ( write_results )
-        {
-          char filename[1024];
-          if ( output_postfix.size() > 0 )
-            sprintf ( filename, "%s.%s.%s", fname.c_str(), output_postfix.c_str(), output_type.c_str() );
-          else
-            sprintf ( filename, "%s.%s", fname.c_str(), output_type.c_str() );
-          
-          std::string origfilename = resultdir + "/orig_" + string ( filename );
-          cerr << "Writing to file " << origfilename << endl;
-          orig.write ( origfilename );
-          rgb.write ( resultdir + "/result_" + string ( filename ) );
-          rgb_gt.write ( resultdir + "/groundtruth_" + string ( filename ) );
-          fileno++;
-        }
-
-        if ( show_result )
-        {
-#ifndef NOVISUAL
-          showImage ( rgb, "Result" );
-          showImage ( rgb_gt, "Groundtruth" );
-          showImage ( orig, "Input" );
-#endif
-        }
-      }
-    }
-
-//#pragma omp critical
-    for ( int z = 0; z < segresult.channels(); z++ )
-    {
-      for ( int y = 0 ; y < segresult.height(); y++ )
-      {
-        for ( int x = 0 ; x < segresult.width(); x++ )
-        {
-          lm.setPixel ( x, y, segresult.get ( x, y, ( uint ) z ) );
-          if ( run_3dseg )
-            lm_gt.setPixel ( x, y, gt.get ( x, y, ( uint ) z ) );
-        }
+        NICE::Matrix M ( classNames.getMaxClassno() + 1, classNames.getMaxClassno() + 1 );
+        M.set ( 0 );
+        updateMatrix ( lm, lm_gt, M, forbidden_classes );
+        M_vec.push_back ( M );
       }
-      NICE::Matrix M ( classNames.getMaxClassno() + 1, classNames.getMaxClassno() + 1 );
-      M.set ( 0 );
-      updateMatrix ( lm, lm_gt, M, forbidden_classes );
-      M_vec.push_back ( M );
 
-      cerr << M << endl;
+      // prepare for new 3d image
+      filelist.clear();
+      segresult.reInit(0,0,0);
+      gt.reInit(0,0,0);
+      depthCount = 0;
+      idx++;
+//       pb.update ( testFiles->count() );
     }
-
-    // prepare for new 3d image
-    filelist.clear();
-    segresult.reInit(0,0,0);
-    gt.reInit(0,0,0);
-    depthCount = 0;
-    idx++;
-    imageno++;
-
-    pb.update ( testFiles->count() );
   }
+  
   segresult.freeData();
-  pb.hide();
+//   pb.hide();
 
   long maxMemory;
   rs.getMaximumMemory ( maxMemory );
@@ -289,11 +317,9 @@ int main ( int argc, char **argv )
       }
     }
   }
-
   overall /= sumall;
 
   // normalizing M using rows
-
   for ( int r = 0 ; r < ( int ) M.rows() ; r++ )
   {
     double sum = 0.0;
@@ -306,8 +332,6 @@ int main ( int argc, char **argv )
         M ( r, c ) /= sum;
   }
 
-  cerr << M << endl;
-
   double avg_perf = 0.0;
   int classes_trained = 0;
 
@@ -328,38 +352,24 @@ int main ( int argc, char **argv )
     }
   }
 
-  if ( write_results )
-  {
-    ofstream fout ( ( resultdir + "/res.txt" ).c_str(), ios::out );
-    fout <<  "overall: " << overall << endl;
-    fout << "Average Performance " << avg_perf / ( classes_trained ) << endl;
-    fout << "Lower Bound " << 1.0  / classes_trained << endl;
-
-    for ( int r = 0 ; r < ( int ) M.rows() ; r++ )
-    {
-      if ( ( classNames.existsClassno ( r ) ) && ( forbidden_classes.find ( r ) == forbidden_classes.end() ) )
-      {
-        std::string classname = classNames.text ( r );
-        fout << classname.c_str() << ": " << M ( r, r ) << endl;
-      }
-    }
-
-    fout.close();
-  }
-
+  // print/save results of evaluation
+  ofstream fout ( ( resultdir + "/res.txt" ).c_str(), ios::out );
+  fout <<  "overall: " << overall << endl;
+  fout << "Average Performance " << avg_perf / ( classes_trained ) << endl;
+  fout << "Lower Bound " << 1.0  / classes_trained << endl;
   fprintf ( stderr, "overall: %f\n", overall );
-
   fprintf ( stderr, "Average Performance %f\n", avg_perf / ( classes_trained ) );
-  //fprintf(stderr, "Lower Bound %f\n", 1.0 / classes_trained);
-
+  fprintf(stderr, "Lower Bound %f\n", 1.0 / classes_trained);
   for ( int r = 0 ; r < ( int ) M.rows() ; r++ )
   {
     if ( ( classNames.existsClassno ( r ) ) && ( forbidden_classes.find ( r ) == forbidden_classes.end() ) )
     {
       std::string classname = classNames.text ( r );
+      fout << classname.c_str() << ": " << M ( r, r ) << endl;
       fprintf ( stderr, "%s: %f\n", classname.c_str(), M ( r, r ) );
     }
   }
+  fout.close();
 
   delete semseg;
 

File diff suppressed because it is too large
+ 274 - 323
semseg/SemSegContextTree.cpp


+ 32 - 15
semseg/SemSegContextTree.h

@@ -9,14 +9,14 @@
 #define SemSegContextTreeINCLUDE
 
 #include "SemanticSegmentation.h"
-#include <core/vector/VVector.h>
+#include "core/vector/VVector.h"
+#include "core/image/MultiChannelImage3DT.h"
 #include "vislearning/features/localfeatures/LFColorWeijer.h"
 #include "segmentation/RegionSegmentationMethod.h"
 
 #include "semseg3d/semseg/operations/Operations.h"
-#include "semseg3d/image/MultiChannelImage3DT.h"
 
-#include "gp-hik-exp/GPHIKClassifierNICE.h"
+#include "gp-hik-core/GPHIKClassifier.h"
 
 namespace OBJREC
 {
@@ -25,6 +25,7 @@ namespace OBJREC
 
 class SemSegContextTree : public SemanticSegmentation, public NICE::Persistent
 {
+private:
   /** Segmentation Method */
   RegionSegmentationMethod *segmentation;
 
@@ -76,7 +77,7 @@ class SemSegContextTree : public SemanticSegmentation, public NICE::Persistent
   /** how many splittests */
   int randomTests;
 
-  /** operations for pairwise features */
+  /** prototype operations for pairwise features */
   std::vector<std::vector<Operation*> > ops;
 
   std::vector<ValueAccess*> calcVal;
@@ -134,9 +135,15 @@ class SemSegContextTree : public SemanticSegmentation, public NICE::Persistent
 
   /** whether we should use the geometric features of Hoeim (only offline computation with MATLAB supported) */
   bool useHoiemFeatures;
+  
+  /** save / load trained icf classifier */
+  bool saveLoadData;
 
   /** directory of the geometric features */
   std::string hoiemDirectory;
+  
+  /** file location of trained icf classifier */
+  std::string fileLocation;
 
   /** first iteration or not */
   bool firstiteration;
@@ -148,10 +155,16 @@ class SemSegContextTree : public SemanticSegmentation, public NICE::Persistent
   int rawChannels;
 
   /** classifier for categorization */
-  OBJREC::GPHIKClassifierNICE *fasthik;
+  NICE::GPHIKClassifier *fasthik;
 
   /** unique numbers for nodes */
   int uniquenumber;
+  
+  /**
+   * the main training method
+   * @param trainp pointer to training data
+   */
+  void train ( const LabeledSet * trainp );
 
 public:
   /** simple constructor */
@@ -161,15 +174,18 @@ public:
   virtual ~SemSegContextTree();
 
   /**
-   * test a single 3d image
+   * classify each pixel of a single 3d image
    * @param imgData input data
    * @param segresult segmentation results
    * @param probabilities probabilities for each pixel
    */
-  void semanticseg ( NICE::MultiChannelImage3DT<double> & imgData, NICE::MultiChannelImageT<double> & segresult, NICE::MultiChannelImage3DT<double> & probabilities, const std::vector<std::string> & filelist );
+  void classify ( const NICE::MultiChannelImage3DT<double> &imgData,
+                  NICE::MultiChannelImageT<double> & segresult,
+                  NICE::MultiChannelImage3DT<double> & probabilities,
+                  const std::vector<std::string> & filelist );
 
   /**
-   * the main training method
+   * the training method with checking for already existing trained classifier from file
    * @param md training data
    */
   void train ( const MultiDataset *md );
@@ -177,11 +193,12 @@ public:
   /**
    * @brief computes integral image of given feats
    *
-   * @param currentfeats input features
+   * @param nodeIndices matrix with current node for each feature
    * @param integralImage output image (must be initilized)
+   * @param firstChannel index of the first channel
    * @return void
    **/
-  void computeIntegralImage ( const NICE::MultiChannelImage3DT<unsigned short int> &currentfeats, NICE::MultiChannelImage3DT<double> &lfeats, int firstChannel );
+  void computeIntegralImage ( const NICE::MultiChannelImage3DT<unsigned short int> &nodeIndices, NICE::MultiChannelImage3DT<double> &integralImage, int firstChannel );
 
   /**
    * @brief reads image and does some simple convertions
@@ -195,14 +212,14 @@ public:
   /**
    * compute best split for current settings
    * @param feats features
-   * @param currentfeats matrix with current node for each feature
+   * @param nodeIndices matrix with current node for each feature
    * @param labels labels for each feature
    * @param node current node
    * @param splitfeat output feature position
    * @param splitval
-   * @return best information gain
+   * @return void
    */
-  double getBestSplit ( std::vector<NICE::MultiChannelImage3DT<double> > &feats, std::vector<NICE::MultiChannelImage3DT<unsigned short int> > &currentfeats, const std::vector<NICE::MultiChannelImageT<int> > &labels, int node, Operation *&splitop, double &splitval, const int &tree, std::vector<std::vector<std::vector<double> > > &regionProbs );
+  double getBestSplit ( std::vector<NICE::MultiChannelImage3DT<double> > &feats, std::vector<NICE::MultiChannelImage3DT<unsigned short int> > &nodeIndices, const std::vector<NICE::MultiChannelImageT<int> > &labels, int node, Operation *&splitop, double &splitval, const int &tree, std::vector<std::vector<std::vector<double> > > &regionProbs );
 
   /**
    * @brief computes the mean probability for a given class over all trees
@@ -210,10 +227,10 @@ public:
    * @param y y position
    * @param z z position
    * @param channel current class
-   * @param currentfeats information about the nodes
+   * @param nodeIndices matrix with current node for each feature
    * @return double mean value
    **/
-  inline double getMeanProb ( const int &x, const int &y, const int &z, const int &channel, const NICE::MultiChannelImage3DT<unsigned short int> &currentfeats );
+  inline double getMeanProb ( const int &x, const int &y, const int &z, const int &channel, const NICE::MultiChannelImage3DT<unsigned short int> &nodeIndices );
 
   /**
    * @brief load all data to is stream

+ 43 - 46
semseg/SemanticSegmentation.cpp

@@ -1,7 +1,7 @@
 /**
 * @file SemanticSegmentation.cpp
 * @brief abstract interface for semantic segmentation algorithms
-* @author Erik Rodner
+* @author Erik Rodner and Sven Sickert
 * @date 03/19/2009
 
 */
@@ -10,7 +10,7 @@
 #include "SemanticSegmentation.h"
 #include "vislearning/baselib/Preprocess.h"
 #include "vislearning/baselib/Globals.h"
-#include "semseg3d/image/MultiChannelImage3DT.h"
+#include "core/image/MultiChannelImage3DT.h"
 #include "core/basics/StringTools.h"
 
 using namespace OBJREC;
@@ -169,32 +169,44 @@ void SemanticSegmentation::getDepthVector ( const LabeledSet *Files, vector<int>
   int zsize = 0;
   bool isInit = false;
 
-  LOOP_ALL_S ( *Files )
+  for (LabeledSet::const_iterator it = Files->begin(); it != Files->end(); it++)
   {
-    EACH_INFO ( classno, info );
-    std::string file = info.img();
-
-    std::vector< std::string > list;
-    StringTools::split ( file, '/', list );
-    std::string filename = list.back();
-    uint found = filename.find_last_of ( "_" );
-    std::string curName = filename.substr ( found-3,3 );
-    if ( !isInit )
-    {
-      oldName = curName;
-      isInit = true;
-    }
-    if ( curName.compare ( oldName ) == 0 )
-    {
-      zsize++;
-    }
-    else
+    for (std::vector<ImageInfo *>::const_iterator jt = it->second.begin();
+         jt != it->second.end(); jt++)
     {
-      depthVec.push_back ( zsize );
-      zsize = 1;
-      oldName = curName;
-    }
+      ImageInfo & info = *(*jt);
+      std::string file = info.img();
 
+      std::vector< std::string > list;
+      StringTools::split ( file, '/', list );
+      std::string filename = list.back();
+      uint found = filename.find_last_of ( "_" );
+      if (found < filename.size() )
+      {
+        std::string curName = filename.substr ( found-3,3 );
+        if ( !isInit )
+        {
+          oldName = curName;
+          isInit = true;
+        }
+        if ( curName.compare ( oldName ) == 0 )
+        {
+          zsize++;
+        }
+        else
+        {
+          depthVec.push_back ( zsize );
+          zsize = 1;
+          oldName = curName;
+        }
+      }
+      else
+      {
+        zsize = 1;
+        depthVec.push_back ( zsize );
+      }
+
+    }
   }
   depthVec.push_back ( zsize );
 }
@@ -207,14 +219,15 @@ void SemanticSegmentation::make3DImage ( const std::vector<std::string> & fileli
   {
     if ( imagetype == IMAGETYPE_RGB )
     {
-      NICE::ColorImageT<int> img;
+      NICE::ColorImage img;
       try
       {
         img.read ( filelist[it] );
       }
-      catch ( ImageException & )
+      catch ( ImageException iE )
       {
-        fprintf ( stderr, "Failed to open image file: %s\n", filelist[it].c_str() );
+        fprintf ( stderr, "Failed to open color image file: %s\n", filelist[it].c_str() );
+        fprintf ( stderr, "%s\n", iE.what() );
         exit ( -1 );
       }
       if ( !isInit )
@@ -240,9 +253,10 @@ void SemanticSegmentation::make3DImage ( const std::vector<std::string> & fileli
       {
         img.read ( filelist[it] );
       }
-      catch ( ImageException & )
+      catch ( ImageException iE )
       {
         fprintf ( stderr, "Failed to open image file: %s\n", filelist[it].c_str() );
+        fprintf ( stderr, "%s\n", iE.what() );
         exit ( -1 );
       }
       if ( !isInit )
@@ -263,23 +277,6 @@ void SemanticSegmentation::make3DImage ( const std::vector<std::string> & fileli
   if ( imagetype == IMAGETYPE_GRAY )
   {
     imgData.correctShading( 0 );
-    double val_max, val_min;
-    imgData.statistics(val_min, val_max, 0);
-    if ( val_max > 255 )
-    {
-      for( int z = 0; z < imgData.depth(); z++ )
-      {
-        for ( int y = 0; y < imgData.height(); y++ )
-        {
-          for ( int x = 0; x < imgData.width(); x++ )
-          {
-            double val = imgData.get ( x, y, z, 0 );
-            val = val / val_max * 255;
-            imgData.set(x, y, z, val, 0);
-          }
-        }
-      }
-    }
   }
 }
 

+ 66 - 62
semseg/SemanticSegmentation.h

@@ -9,7 +9,7 @@
 #define SEMANTICSEGMENTATIONINCLUDE
 
 #include <vector>
-#include "semseg3d/image/MultiChannelImage3DT.h"
+#include "core/image/MultiChannelImage3DT.h"
 #include "vislearning/cbaselib/MultiDataset.h"
 #include "vislearning/cbaselib/LocalizationResult.h"
 #include "vislearning/cbaselib/CachedExample.h"
@@ -23,67 +23,71 @@ namespace OBJREC
 class SemanticSegmentation
 {
 
-  protected:
-    /** accessible class names and information about
-        number of classes etc. */
-    const ClassNames *classNames;
-
-    /** enum type for imagetype */
-    enum
-    {
-      IMAGETYPE_RGB = 0,
-      IMAGETYPE_GRAY
-    };
-
-    /** whether to load images with color information */
-    int imagetype;
-
-  public:
-
-    /** simple constructor
-        @param conf global settings
-        @param classNames this ClassNames object while be stored as a attribute
-    */
-    SemanticSegmentation ( const NICE::Config *conf,
-                           const ClassNames *classNames );
-
-    /** simple destructor */
-    virtual ~SemanticSegmentation();
-
-    /** this function has to be overloaded by all subclasses
-        @param imgData image data
-        @param segresult result of the semantic segmentation with a label for each
-        pixel
-        @param probabilities multi-channel image with one channel for each class and
-               corresponding probabilities for each pixel
-    */
-		
-		/**
-		 * collect information about the depth of 3d images
-		 * @param *Files a labeled set of data
-		 * @param depthVec output of depth values
-		 */
-		void getDepthVector( const LabeledSet *Files, std::vector<int> & depthVec );
-		
-		virtual void semanticseg ( NICE::MultiChannelImage3DT<double> & imgData,
-															 NICE::MultiChannelImageT<double> & segresult,
-															 NICE::MultiChannelImage3DT<double> & probabilities,
-															 const std::vector<std::string> & filelist ) = 0;
-
-    /**
-     * convert different datatypes
-     */
-    void convertVVectorToExamples ( NICE::VVector &feats,OBJREC::Examples &examples, std::vector<int> &label );
-    void convertExamplesToVVector ( NICE::VVector &feats,OBJREC::Examples &examples, std::vector<int> &label );
-    void convertExamplesToLSet ( OBJREC::Examples &examples, OBJREC::LabeledSetVector &lvec );
-    void convertLSetToExamples ( OBJREC::Examples &examples, OBJREC::LabeledSetVector &lvec );
-    void convertLSetToSparseExamples ( OBJREC::Examples &examples, OBJREC::LabeledSetVector &lvec );
-
-		/** 
-		 *load image slices into a single MCI3DT 
-		 */
-		void make3DImage ( const std::vector<std::string> & filelist,
-											 NICE::MultiChannelImage3DT<double> & imgData );
+protected:
+  /** accessible class names and information about
+      number of classes etc. */
+  const ClassNames *classNames;
+
+  /** enum type for imagetype */
+  enum
+  {
+    IMAGETYPE_RGB = 0,
+    IMAGETYPE_GRAY
+  };
+
+  /** whether to load images with color information */
+  int imagetype;
+
+public:
+
+  /** simple constructor
+      @param conf global settings
+      @param classNames this ClassNames object while be stored as a attribute
+  */
+  SemanticSegmentation ( const NICE::Config *conf,
+                         const ClassNames *classNames );
+
+  /** simple destructor */
+  virtual ~SemanticSegmentation();
+
+  /** classification function (has to be overloaded by all subclasses)
+   * @param imgData image data
+   * @param segresult result of the semantic segmentation with a label for each pixel
+   * @param probabilities multi-channel image with one channel for each class and
+   *        corresponding probabilities for each pixel
+   * @param filelist filename list of images that represent slices of a stack
+   */
+  virtual void classify ( const NICE::MultiChannelImage3DT<double> & imgData,
+                          NICE::MultiChannelImageT<double> & segresult,
+                          NICE::MultiChannelImage3DT<double> & probabilities,
+                          const std::vector<std::string> & filelist ) = 0;
+
+  /** training function (has to be overloaded by all subclasses)
+   * @param md the data set
+   */
+  virtual void train ( const MultiDataset * md ) = 0;
+
+  /**
+   * collect information about the depth of 3d images
+   * @param *Files a labeled set of data
+   * @param depthVec output of depth values
+   */
+  void getDepthVector ( const LabeledSet *Files, std::vector<int> & depthVec );
+
+  /**
+   * convert different datatypes
+   */
+  void convertVVectorToExamples ( NICE::VVector &feats,OBJREC::Examples &examples, std::vector<int> &label );
+  void convertExamplesToVVector ( NICE::VVector &feats,OBJREC::Examples &examples, std::vector<int> &label );
+  void convertExamplesToLSet ( OBJREC::Examples &examples, OBJREC::LabeledSetVector &lvec );
+  void convertLSetToExamples ( OBJREC::Examples &examples, OBJREC::LabeledSetVector &lvec );
+  void convertLSetToSparseExamples ( OBJREC::Examples &examples, OBJREC::LabeledSetVector &lvec );
+
+  /**
+   *load image slices into a single MCI3DT
+   */
+  void make3DImage ( const std::vector<std::string> & filelist,
+                     NICE::MultiChannelImage3DT<double> & imgData );
 
 };
 

+ 20 - 50
semseg/operations/Operations.h

@@ -7,7 +7,7 @@
 */
 
 #include "core/image/MultiChannelImageT.h"
-#include "semseg3d/image/MultiChannelImage3DT.h"
+#include "core/image/MultiChannelImage3DT.h"
 
 #define BOUND(x,min,max) (((x)<(min))?(min):((x)>(max)?(max):(x)))
 
@@ -93,6 +93,20 @@ class TreeNode
 
     /** standard constructor */
     TreeNode ( int _left, int _right, Operation *_feat, double _decision ) : left ( _left ), right ( _right ), feat ( _feat ), decision ( _decision ), isleaf ( false ) {}
+
+    /**
+     * @brief initialize node
+     * @param _depth current depth in tree
+     * @param _numClasses amount of classes (initialize distribution)
+     * @param _nodeNumber unique node number
+     */
+    void init( int _depth, int _numClasses, int _nodeNumber)
+    {
+      depth = _depth;
+      featcounter = 0;
+      dist = std::vector<double> (_numClasses, 0.0);
+      nodeNumber = _nodeNumber;
+    }
 };
 
 /**
@@ -102,13 +116,13 @@ struct Features {
   /** simple features like RGB values */
   NICE::MultiChannelImage3DT<double> *feats;
 
-  /** current leaf position for each pixel and each tree */
-  NICE::MultiChannelImage3DT<unsigned short int> *cfeats;
+  /** node index for each pixel (width,height,depth) in each tree (channel) */
+  NICE::MultiChannelImage3DT<unsigned short int> *nIndices;
 
-  /** amount of trees */
+  /** current tree index */
   int cTree;
 
-  /** tree nodes */
+  /** current tree (all nodes) */
   std::vector<TreeNode> *tree;
   
   /** probabilities for each region */
@@ -206,7 +220,7 @@ class ClassificationResultAccess: public ValueAccess
      **/
     virtual double getVal ( const Features &feats, const int &x, const int &y, const int &z, const int &channel )
     {
-      return ( *feats.tree ) [feats.cfeats->get ( x,y,z,feats.cTree ) ].dist[channel];
+      return ( *feats.tree ) [feats.nIndices->get ( x,y,z,feats.cTree ) ].dist[channel];
     }
 
     /**
@@ -345,8 +359,6 @@ class Operation
     /**
      * @brief abstract interface for feature computation
      * @param feats features
-     * @param cfeats number of tree node for each pixel
-     * @param tree current tree
      * @param x current x position
      * @param y current y position
 		 * @param z current z position
@@ -405,8 +417,6 @@ class RegionFeat: public Operation
     /**
      * @brief interface for feature computation
      * @param feats features
-     * @param cfeats number of tree node for each pixel
-     * @param tree current tree
      * @param x current x position
      * @param y current y position
 		 * @param z current z position
@@ -455,8 +465,6 @@ class Minus: public Operation
     /**
      * @brief interface for feature computation
      * @param feats features
-     * @param cfeats number of tree node for each pixel
-     * @param tree current tree
      * @param x current x position
      * @param y current y position
 		 * @param z current z position
@@ -506,8 +514,6 @@ class MinusAbs: public Operation
     /**
      * @brief interface for feature computation
      * @param feats features
-     * @param cfeats number of tree node for each pixel
-     * @param tree current tree
      * @param x current x position
      * @param y current y position
 		 * @param z current z position
@@ -557,8 +563,6 @@ class Addition: public Operation
     /**
      * @brief interface for feature computation
      * @param feats features
-     * @param cfeats number of tree node for each pixel
-     * @param tree current tree
      * @param x current x position
      * @param y current y position
 		 * @param z current z position
@@ -607,8 +611,6 @@ class Only1: public Operation
     /**
      * @brief interface for feature computation
      * @param feats features
-     * @param cfeats number of tree node for each pixel
-     * @param tree current tree
      * @param x current x position
      * @param y current y position
 		 * @param z current z position
@@ -657,8 +659,6 @@ class RelativeXPosition: public Operation
     /**
      * @brief interface for feature computation
      * @param feats features
-     * @param cfeats number of tree node for each pixel
-     * @param tree current tree
      * @param x current x position
      * @param y current y position
 		 * @param z current z position
@@ -702,8 +702,6 @@ class RelativeYPosition: public Operation
     /**
      * @brief interface for feature computation
      * @param feats features
-     * @param cfeats number of tree node for each pixel
-     * @param tree current tree
      * @param x current x position
      * @param y current y position
 		 * @param z current z position
@@ -747,8 +745,6 @@ class RelativeZPosition: public Operation
     /**
      * @brief interface for feature computation
      * @param feats features
-     * @param cfeats number of tree node for each pixel
-     * @param tree current tree
      * @param x current x position
      * @param y current y position
 		 * @param z current z position
@@ -807,8 +803,6 @@ class IntegralOps: public Operation
     /**
      * @brief interface for feature computation
      * @param feats features
-     * @param cfeats number of tree node for each pixel
-     * @param tree current tree
      * @param x current x position
      * @param y current y position
 		 * @param z current z position
@@ -854,8 +848,6 @@ class GlobalFeats: public IntegralOps
     /**
      * @brief interface for feature computation
      * @param feats features
-     * @param cfeats number of tree node for each pixel
-     * @param tree current tree
      * @param x current x position
      * @param y current y position
 		 * @param z current z position
@@ -914,8 +906,6 @@ class IntegralCenteredOps: public IntegralOps
     /**
      * @brief interface for feature computation
      * @param feats features
-     * @param cfeats number of tree node for each pixel
-     * @param tree current tree
      * @param x current x position
      * @param y current y position
 		 * @param z current z position
@@ -974,8 +964,6 @@ class BiIntegralCenteredOps: public IntegralCenteredOps
     /**
      * @brief interface for feature computation
      * @param feats features
-     * @param cfeats number of tree node for each pixel
-     * @param tree current tree
      * @param x current x position
      * @param y current y position
 		 * @param z current z position
@@ -1021,8 +1009,6 @@ class HaarHorizontal: public IntegralCenteredOps
     /**
      * @brief interface for feature computation
      * @param feats features
-     * @param cfeats number of tree node for each pixel
-     * @param tree current tree
      * @param x current x position
      * @param y current y position
 		 * @param z current z position
@@ -1068,8 +1054,6 @@ class HaarVertical: public IntegralCenteredOps
     /**
      * @brief interface for feature computation
      * @param feats features
-     * @param cfeats number of tree node for each pixel
-     * @param tree current tree
      * @param x current x position
      * @param y current y position
 		 * @param z current z position
@@ -1115,8 +1099,6 @@ class HaarStacked: public IntegralCenteredOps
     /**
      * @brief interface for feature computation
      * @param feats features
-     * @param cfeats number of tree node for each pixel
-     * @param tree current tree
      * @param x current x position
      * @param y current y position
 		 * @param z current z position
@@ -1162,8 +1144,6 @@ class HaarDiagXY: public IntegralCenteredOps
     /**
      * @brief interface for feature computation
      * @param feats features
-     * @param cfeats number of tree node for each pixel
-     * @param tree current tree
      * @param x current x position
      * @param y current y position
 		 * @param z current z position
@@ -1209,8 +1189,6 @@ class HaarDiagXZ: public IntegralCenteredOps
     /**
      * @brief interface for feature computation
      * @param feats features
-     * @param cfeats number of tree node for each pixel
-     * @param tree current tree
      * @param x current x position
      * @param y current y position
 		 * @param z current z position
@@ -1256,8 +1234,6 @@ class HaarDiagYZ: public IntegralCenteredOps
     /**
      * @brief interface for feature computation
      * @param feats features
-     * @param cfeats number of tree node for each pixel
-     * @param tree current tree
      * @param x current x position
      * @param y current y position
 		 * @param z current z position
@@ -1305,8 +1281,6 @@ class Haar3Horiz: public BiIntegralCenteredOps
     /**
      * @brief interface for feature computation
      * @param feats features
-     * @param cfeats number of tree node for each pixel
-     * @param tree current tree
      * @param x current x position
      * @param y current y position
 		 * @param z current z position
@@ -1353,8 +1327,6 @@ class Haar3Vert: public BiIntegralCenteredOps
     /**
      * @brief interface for feature computation
      * @param feats features
-     * @param cfeats number of tree node for each pixel
-     * @param tree current tree
      * @param x current x position
      * @param y current y position
 		 * @param z current z position
@@ -1401,8 +1373,6 @@ class Haar3Stack: public BiIntegralCenteredOps
     /**
      * @brief interface for feature computation
      * @param feats features
-     * @param cfeats number of tree node for each pixel
-     * @param tree current tree
      * @param x current x position
      * @param y current y position
 		 * @param z current z position

Some files were not shown because too many files changed in this diff