Commit 71e18ff0 authored by jaco's avatar jaco

Pull Request mandatory changes finished

parent e670bd57
...@@ -64,7 +64,7 @@ public: ...@@ -64,7 +64,7 @@ public:
//StaticSaliencySpectralResidual( const StaticSaliencySpectralResidual::Params &parameters = StaticSaliencySpectralResidual::Params() ); //StaticSaliencySpectralResidual( const StaticSaliencySpectralResidual::Params &parameters = StaticSaliencySpectralResidual::Params() );
StaticSaliencySpectralResidual(); StaticSaliencySpectralResidual();
~StaticSaliencySpectralResidual(); virtual ~StaticSaliencySpectralResidual();
void read( const FileNode& fn ); void read( const FileNode& fn );
void write( FileStorage& fs ) const; void write( FileStorage& fs ) const;
...@@ -92,7 +92,7 @@ class CV_EXPORTS MotionSaliencyBinWangApr2014 : public MotionSaliency ...@@ -92,7 +92,7 @@ class CV_EXPORTS MotionSaliencyBinWangApr2014 : public MotionSaliency
{ {
public: public:
MotionSaliencyBinWangApr2014(); MotionSaliencyBinWangApr2014();
~MotionSaliencyBinWangApr2014(); virtual ~MotionSaliencyBinWangApr2014();
void setImagesize( int W, int H ); void setImagesize( int W, int H );
bool init(); bool init();
...@@ -122,7 +122,7 @@ private: ...@@ -122,7 +122,7 @@ private:
// for each pixel. In the second layer, there are the C (efficacy) value for each pixel // for each pixel. In the second layer, there are the C (efficacy) value for each pixel
Mat potentialBackground;// Two channel Matrix. For each pixel, in the first level there are the Ba value (potential background value) Mat potentialBackground;// Two channel Matrix. For each pixel, in the first level there are the Ba value (potential background value)
// and in the secon level there are the Ca value, the counter for each potential value. // and in the secon level there are the Ca value, the counter for each potential value.
Mat epslonPixelsValue;// epslon threshold Mat epslonPixelsValue; // epslon threshold
//Mat activityPixelsValue; // Activity level of each pixel //Mat activityPixelsValue; // Activity level of each pixel
//vector<Mat> noisePixelMask; // We define a ‘noise-pixel’ as a pixel that has been classified as a foreground pixel during the full resolution //vector<Mat> noisePixelMask; // We define a ‘noise-pixel’ as a pixel that has been classified as a foreground pixel during the full resolution
// detection process,however, after the low resolution detection, it has become a // detection process,however, after the low resolution detection, it has become a
...@@ -163,7 +163,7 @@ class CV_EXPORTS ObjectnessBING : public Objectness ...@@ -163,7 +163,7 @@ class CV_EXPORTS ObjectnessBING : public Objectness
public: public:
ObjectnessBING(); ObjectnessBING();
~ObjectnessBING(); virtual ~ObjectnessBING();
void read(); void read();
void write() const; void write() const;
......
...@@ -62,6 +62,16 @@ static void help() ...@@ -62,6 +62,16 @@ static void help()
<< endl; << endl;
} }
inline float calcOverlap( Rect a, Rect b )
{
Rect rectIntersection = a & b;
Rect rectUnion = a | b;
float iArea = rectIntersection.width * rectIntersection.height;
float uArea = rectUnion.width * rectUnion.height;
float overlap = iArea / uArea;
return overlap;
}
int main( int argc, char** argv ) int main( int argc, char** argv )
{ {
CommandLineParser parser( argc, argv, keys ); CommandLineParser parser( argc, argv, keys );
...@@ -139,7 +149,6 @@ int main( int argc, char** argv ) ...@@ -139,7 +149,6 @@ int main( int argc, char** argv )
else else
{ {
vector<Vec4i> saliencyMap; vector<Vec4i> saliencyMap;
saliencyAlgorithm.dynamicCast<ObjectnessBING>()->setTrainingPath( training_path ); saliencyAlgorithm.dynamicCast<ObjectnessBING>()->setTrainingPath( training_path );
saliencyAlgorithm.dynamicCast<ObjectnessBING>()->setBBResDir( training_path + "/Results" ); saliencyAlgorithm.dynamicCast<ObjectnessBING>()->setBBResDir( training_path + "/Results" );
......
...@@ -72,8 +72,8 @@ MotionSaliencyBinWangApr2014::MotionSaliencyBinWangApr2014() ...@@ -72,8 +72,8 @@ MotionSaliencyBinWangApr2014::MotionSaliencyBinWangApr2014()
K = 3; // Number of background model template K = 3; // Number of background model template
N = 4; // NxN is the size of the block for downsampling in the lowlowResolutionDetection N = 4; // NxN is the size of the block for downsampling in the lowlowResolutionDetection
alpha = (float) 0.01; // Learning rate alpha = (float) 0.01; // Learning rate
L0 = 300; // Upper-bound values for C0 (efficacy of the first template (matrices) of backgroundModel L0 = 1000; // Upper-bound values for C0 (efficacy of the first template (matrices) of backgroundModel
L1 = 200; // Upper-bound values for C1 (efficacy of the second template (matrices) of backgroundModel L1 = 800; // Upper-bound values for C1 (efficacy of the second template (matrices) of backgroundModel
thetaL = thetaL_VAL; // T0, T1 swap threshold thetaL = thetaL_VAL; // T0, T1 swap threshold
thetaA = thetaA_VAL; thetaA = thetaA_VAL;
gamma = 3; gamma = 3;
...@@ -384,8 +384,8 @@ bool MotionSaliencyBinWangApr2014::templateReplacement( const Mat& finalBFMask, ...@@ -384,8 +384,8 @@ bool MotionSaliencyBinWangApr2014::templateReplacement( const Mat& finalBFMask,
//if at least the first template is activated / initialized for all pixels //if at least the first template is activated / initialized for all pixels
if( countNonZero( temp[1] ) <= ( temp[1].cols * temp[1].rows ) / 2 ) if( countNonZero( temp[1] ) <= ( temp[1].cols * temp[1].rows ) / 2 )
{ {
thetaA = 15; thetaA = 50;
thetaL = 40; thetaL = 150;
neighborhoodCheck = false; neighborhoodCheck = false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment