opencv/findContour crashes, v2.4.4, MS visual studio 2010. edit:damaged head.
edit 2: When the error message occur, I press continue and get a new error message:
Unhandled exception at 0x770540f2 in eyeTracking.exe: 0xC0000374: A heap is damaged
(A heap is damaged) is translated from swedish, so the exact line of text might be different from what you are familiar with.
--------end of edit 2.---------
edit 1: System: windows7, 64bit. --------end of edit 1.---------
I have developed a system that detects & tracks the face of a person(real time, with usb camera). From that data I want to collect parameters from the eyes (blinks for example). Everything works fine until I try to use the command findContour,
std::vector< std::vector<cv::Point> > contours;
cv::findContours( test, contours, CV_RETR_EXTERNAL,CV_CHAIN_APPROX_NONE );
I've tried this for a couple of days now, but I cant figure it out how to make it work. Examples from internet doesnt work either.
Before I run the method cv::findContours() I run the following methods:
m = ~currentWebCamFrame(trackP.EyePosition(false));
cv::cvtColor(m,n, CV_RGB2GRAY);
cv::threshold(n, m, threshold-value, 255,CV_THRESH_BINARY);
cv::erode(m, n, cv::Mat(),cv::Point(-1,-1),n_erode_dilate);
cv::dilate(n, m, cv::Mat(),cv::Point(-1,-1),n_erode_dilate);
test = m.clone();
When I output the image "test" this is the result:
Before I run the "findContour()" I test the following:
if((!test.empty()) && (test.type() == CV_8UC1)){ };
There is no available error message from opencv, the program just crashed. I printf() some text right before and after. And it is only the text before that is visible in the console.
The message from Visual studio is:
Windows has triggered a breakpoint in eyeTracking.exe.
This may be due to a corruption of the heap, which indicates a bug in the eyeTracking.exe or any of the DLLs it has loaded.
This May also be due to the user pressing F12 while eyeTracking has focus.
I dont know what to do, so if there is anyone that has any idea, please let me know!
Thanks!
I have the same problem in VS 2010. The problem was solved when I change option 'Use of MFC' to 'Use MFC in a Shared DLL'. But I still not understand why it could not work with static MFC dll.