Home > other >  After using Opencv function vector <Mat> release error problem
After using Opencv function vector <Mat> release error problem

Time:10-14

 vector Imgs; 
Imgs. Reserve (100);
Imgs. Push_back (imread (" 20191218103826 PNG "));
Imgs. Push_back (imread (" 20191218103828 PNG "));
//imgs. Push_back (imread (" 20191218103830 PNG "));

Mat res;
Stitcher Stitcher=Stitcher: : createDefault (false);
Stitcher: : the Status Status=Stitcher. Stitch (imgs, res);


When using Opencv image matching function Stitcher, need use vector To hold the image to be processed, the problem is Stitcher function after use, when to quit the module system will automatically release vector And then jump straight to _free_base error, the problem in the Debug mode (MFC: Shared DLL + runtime: multi-threaded debugging DLLS (/MDd) + dependent libraries opencv_stitching249d. Lib) is not going to happen, only in the Release mode (MFC: static library + runtime: multithreading (/MT) + dependent libraries opencv_stitching249. Lib),
Some post said before using opencv function vector type of data in advance application memory space, normal only after release, tried to use the reserve in advance to apply for space, or complains,
Do feature detection using vector< before; KeyPoint> Types of data, is also a similar problem, then use the reserve in advance to apply for space to solve the problem, I don't know why the vector No,
I now have VS2010 + opencv 2.4.9, please everyone a great god guidance!
  • Related