Commit b2f4affb authored by jaco's avatar jaco

templateReplacement function completed

parent 9a196a9c
...@@ -120,7 +120,7 @@ class CV_EXPORTS_W MotionSaliencyBinWangApr2014 : public MotionSaliency ...@@ -120,7 +120,7 @@ class CV_EXPORTS_W MotionSaliencyBinWangApr2014 : public MotionSaliency
// Background model maintenance functions // Background model maintenance functions
bool templateOrdering(); bool templateOrdering();
bool templateReplacement( Mat finalBFMask, Mat image ); bool templateReplacement( const Mat& finalBFMask, const Mat& image );
// Decision threshold adaptation and Activity control function // Decision threshold adaptation and Activity control function
//bool activityControl(vector<Mat> noisePixelMask); //bool activityControl(vector<Mat> noisePixelMask);
......
...@@ -156,29 +156,33 @@ int main( int argc, char** argv ) ...@@ -156,29 +156,33 @@ int main( int argc, char** argv )
} }
else if( saliency_algorithm.find( "BinWangApr2014" ) == 0 ) else if( saliency_algorithm.find( "BinWangApr2014" ) == 0 )
{ {
Ptr<Size> size= Ptr<Size>( new Size( 32, 32 ) ) ; // TODO INSERT CAPTURE CICLE FOR MOTION
saliencyAlgorithm.dynamicCast<MotionSaliencyBinWangApr2014>()->setWsize(size); //int testSize = 34;
//Ptr<Size> size = Ptr<Size>( new Size( testSize, testSize ) );
Ptr<Size> size = Ptr<Size>( new Size( image.cols, image.rows ) );
saliencyAlgorithm.dynamicCast<MotionSaliencyBinWangApr2014>()->setWsize( size );
saliencyAlgorithm.dynamicCast<MotionSaliencyBinWangApr2014>()->init(); saliencyAlgorithm.dynamicCast<MotionSaliencyBinWangApr2014>()->init();
// Create an fake image test /* // Create an fake image test
Mat test( 32, 32, CV_8U ); Mat test( testSize, testSize, CV_8U );
RNG rand; RNG rand;
for(int i=0; i<test.rows; i++) for ( int i = 0; i < test.rows; i++ )
for(int j=0; j<test.cols; j++) {
{ for ( int j = 0; j < test.cols; j++ )
if(i<12 && i>=6 && j<12 && j>=6) {
test.at<uchar>(i,j)=255; if( i < 6 && i >= 0 && j < 34 && j >= 28 )
else test.at<uchar>( i, j ) = 255;
test.at<uchar>(i,j)=rand.uniform(40,60); else
test.at<uchar>( i, j ) = rand.uniform( 40, 60 );
}
}
} */
//imshow("Test", test); //imshow("Test", test);
//waitKey(0); //waitKey(0);
Mat saliencyMap; Mat saliencyMap;
if( saliencyAlgorithm->computeSaliency( test, saliencyMap ) ) if( saliencyAlgorithm->computeSaliency( image /*test*/, saliencyMap ) )
{ {
std::cout<<"motion saliency done"<<std::endl; std::cout << "motion saliency done" << std::endl;
} }
} }
......
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