delmottea / libCMT

c++ port of the python code from https://github.com/gnebehay/CMT
BSD 3-Clause "New" or "Revised" License
67 stars 45 forks source link

error "This may be due to a corruption of the heap,or any of the DLLs it has loaded" when running cmt.initialise() function #14

Open lethanhtoan2004 opened 9 years ago

lethanhtoan2004 commented 9 years ago

Hi all, I download the lasted code from the website and run but always received the error "This may be due to a corruption of the heap,or any of the DLLs it has loaded" when running the cmt.initialise ( ) function. I tried to debug line by line and detected that there are problems at the following line of code std::vectorstd::string list; cv::Algorithm::getList(list);

std::vectorcv::KeyPoint keypoints; detector->detect(im_gray0, keypoints); I tried out two way to make the function works First method, "list" and "keypoints" variables declared as static variables something like static std::vectorstd::string list; cv::Algorithm::getList(list);

static std::vectorcv::KeyPoint keypoints; detector->detect(im_gray0, keypoints);

Second method, move those variable to cmt() constructor

I am not sure is there anyone here facing the same error like me when running the program. I wonder whether two method i made here to make the function works is correct or not. if you know better solution and explain me why the error happens and what is the right or potential solution to fix the issue , i would appreciate your help. Thank you very much.

delmottea commented 9 years ago

the variable list was used for debug but is not used anymore so we could remove the two lines std::vectorstd::string list; cv::Algorithm::getList(list);

but it doesn't seem to be the cause of the bug. does it works with this modification (or it bug again later in the code?)

lethanhtoan2004 commented 9 years ago

Hi Delmottea, Could you please help to test with some of my image that i have uploaded on my public dropbox folder https://www.dropbox.com/sh/flg9jnyx5z9dsmw/AABQoCAZH2azjWe6D_4PbO3wa?dl=0 The coordinates in the first frame are cv::Point2f initTopLeft(214,313); cv::Point2f initBottomDown(323,453);

My email address is lethanhtoan20042001@yahoo.com. if you can't download please let me know your email address so i can send it to you via email. Appreciate your help, since i have tried to debug the code for whole week but not yet able to run the code. What i achieve so far is able to extract keypoints in the first frame. Thank you very much

lethanhtoan2004 commented 9 years ago

I found the problem that because I uncommented the rest of the code in "initialise" function, therefore activeKeypoints were not assigned in the first frame. That was bad because the following function