|
@@ -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 (
|