|
@@ -253,21 +253,47 @@ double RelativeZPosition3D::getVal ( const Features &feats, const int &x, const
|
|
|
}
|
|
|
|
|
|
|
|
|
+//######################## local statistical moments ###########################
|
|
|
|
|
|
|
|
|
+double LocalMean3D::getVal ( const Features &feats, const int &x, const int &y, const int &z )
|
|
|
+{
|
|
|
+ int w = (int)floor(wsize/2.0);
|
|
|
+ return feats.feats->getIntegralValue( x - w, y - w, z - w, x + w, y + w, z + w, channel1 );
|
|
|
+}
|
|
|
|
|
|
-//########################### integral operations #############################
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-double GlobalFeats3D::getVal ( const Features &feats, const int &x, const int &y, const int &z )
|
|
|
+double LocalStatMom3D::getVal ( const Features &feats, const int &x, const int &y, const int &z )
|
|
|
{
|
|
|
int xsize, ysize, zsize;
|
|
|
getXYZ ( feats, xsize, ysize, zsize );
|
|
|
|
|
|
- return feats.feats->getIntegralValue( 0, 0, 0, xsize - 1, ysize - 1, zsize - 1, channel1 );
|
|
|
+ double mean = 0.0, var = 0.0;
|
|
|
+ const unsigned short w = (int)floor(wsize/2.0);
|
|
|
+ const unsigned short order = (abs(x1) % 3) + 2;
|
|
|
+ mean = feats.feats->getIntegralValue( x - w, y - w, z - w, x + w, y + w, z + w, channel1 );
|
|
|
+
|
|
|
+ unsigned int count = 0;
|
|
|
+ for ( short int i = -w; i <= w ; i++ )
|
|
|
+ for ( short int j = -w; j <= w ; j++ )
|
|
|
+ for ( short int k = -w; k <= w ; k++, count++ )
|
|
|
+ {
|
|
|
+ double val = intToRaw( feats,
|
|
|
+ BOUND( x+i, 0, xsize-1 ),
|
|
|
+ BOUND( y+j, 0, ysize-1 ),
|
|
|
+ BOUND( z+k, 0, zsize-1 ),
|
|
|
+ channel1 );
|
|
|
+ var += pow((val-mean),(double)order);
|
|
|
+ }
|
|
|
+
|
|
|
+ var /= (double)count;
|
|
|
+
|
|
|
+ return var;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+//########################### rectangle operations #############################
|
|
|
+
|
|
|
+
|
|
|
void IntegralOps3D::set ( int _x1, int _y1, int _z1, int _x2, int _y2, int _z2, int _channel1, int _channel2, int _featType )
|
|
|
{
|
|
|
channel1 = _channel1;
|