memory leak in ChamferMatcher::Matching::matchTemplates (Bug #1654)
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
Associated revisions
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