Assertion in algorithm.cpp thrown (Bug #2101)


Added by Stephan Reuter over 12 years ago. Updated over 12 years ago.


Status:Done Start date:2012-06-27
Priority:Normal Due date:
Assignee:Vadim Pisarevsky % Done:

0%

Category:core
Target version:2.4.2
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

in our framework, the modules using opencv are dynamically loaded. During loading the modules a second time, the assertion
CV_Assert( i == 0 || vec[i].first != vec[i-1].first );
in line 65 of algorithm.cpp is thrown due to duplicates in the vector. I suppose due to the staticness the old values are still there.

In my code, I added "if (!alglist().find(_name, create))" to the following method in algorithm.cpp:

AlgorithmInfo::AlgorithmInfo(const string& _name, Algorithm::Constructor create) {
data = new AlgorithmInfoData;
data->_name = _name;
if (!alglist().find(_name, create))
alglist().add(_name, create);
}

Would this be a solution to be integrated in one of the next versions? Otherwise, I suppose, the vector is perhaps not cleared correctly during shutdown.

Thanks

Stephan


Associated revisions

Revision 562838e0
Added by Vadim Pisarevsky over 12 years ago

partial fix for repeated algorithm registration (patch #2101 by Stephan Reuter)

Revision ae795e57
Added by ComFreek about 11 years ago

Corrected package name in tutorial

See also #2101

Revision d01e3529
Added by ComFreek about 11 years ago

Corrected package name in tutorial

See also #2101(cherry picked from commit ae795e5797ba3b85812d56edc7fe497d05cc2d77)

History

Updated by Andrey Kamaev over 12 years ago

  • Category set to core
  • Assignee set to Vadim Pisarevsky

Updated by Vadim Pisarevsky over 12 years ago

thanks! your patch was integrated to SVN, r8867. Not sure if it completely solves the problem, but this extra check does not hurt anyway.

  • Target version set to 2.4.3
  • Status changed from Open to Done

Updated by Andrey Kamaev over 12 years ago

  • Target version changed from 2.4.3 to 2.4.2

Also available in: Atom PDF