Closed pthtruc closed 9 years ago
Anybody?
If I remember correctly, 0 is the default seed anyway. So there might be a chance that your observations are caused by errors somewhere else in the program. Maybe you can use a tool like valgrind to check that.
@gnebehay: Thank you for your feedback. You have a comment in your codes (TDL.cpp, line #308): srand(1); //TODO: This is not guaranteed to affect random_shuffle random_shuffle(negativeIndices.begin(), negativeIndices.end());
Do you think the problem is related to those two lines? Thank you!
This comment was referring to this post here: http://stackoverflow.com/questions/14221763/stdrandom-shuffle-produces-same-result-each-time , that basically states that the source of randomness for random_shuffle is implementation specific, so the call to srand might not have an effect.
I use opentld.lib (and of course, cvblobs.lib) as static lib in my VS2008 application (I do not use the main.lib and config++.lib). I usually got different results running on the same video sequence several times, i.e., the results were not reproducible, especially when executed outside the VS environment. I believe it is due to the random intialization and random_shuffle(negativeIndices.begin(), negativeIndices.end());
I tried to set srand(0) and create a new TLD() in the beginning of every run but it does not help. srand(0); if(myTLD){ delete myTLD; myTLD = new TLD(); }
I also tried with no luck random_shuffle(negativeIndices.begin(), negativeIndices.end(), myrandom); where myrandom is defined as int myrandom (int i) { static bool seeded = seed(); return std::rand()%i; }
Any thoughts, guys? any ... Thanks you.