memory leak in ChamferMatcher::Matching::matchTemplates (Bug #1654)


Added by Changbo Zhou about 13 years ago. Updated almost 13 years ago.


Status:Done Start date:2012-03-07
Priority:Normal Due date:
Assignee:Marina Kolpakova % Done:

0%

Category:legacy, contrib
Target version:2.4.0
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

The following code in "opencv / modules / contrib / src / chamfermatching.cpp" leaks memory:

1ChamferMatcher::Match* is = localChamferDistance(loc, dist_img, orientation_img, tpl, orientation_weight);
2    if(is)
3        matches->push_back(*is);

A modified version of "opencv / samples / cpp /chamfer.cpp" which calls chamerMatching() a hundred times with an increasing memory usage is attached.

It should be like this:

1ChamferMatcher::Match* is = localChamferDistance(loc, dist_img, orientation_img, tpl, orientation_weight);
2if(is){
3    matches->push_back(*is);
4    delete is;
5}

I am testing on :
Windows XP
Visual Studio Professional 2008
OpenCV 2.3.1


cmml.cpp - A modified version of "opencv / samples / cpp /chamfer.cpp" which calls chamerMatching() a hundred times with an increasing memory usage. (1.9 kB) Changbo Zhou, 2012-03-07 07:15 am


Associated revisions

Revision aa19fd50
Added by Marina Kolpakova almost 13 years ago

Fixed bug #1654

History

Updated by Marina Kolpakova almost 13 years ago

Thanks for reporting!

  • Status changed from Open to Done
  • Target version set to 2.4.0
  • Description changed from The following code in "opencv / modules / contrib / src / chamfermatchin... to The following code in "opencv / modules / contrib / src / chamfermatchin... More
  • Category set to legacy, contrib
  • Assignee set to Marina Kolpakova

Also available in: Atom PDF