1

I've asked this question on opencv.org, without any luck, so no I hope that someone here can help me.

I am developing a face/eye tracking software. To measure some values from the eyes (blinks for example). But when I want to use the method

cv::findContour()

The program crashes with a : "Windows has triggered a breakpoint in eyeTracking.exe....." No error message from opencv in the console.

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();

if((!test.empty()) && (test.type() == CV_8UC1)){
std::vector< std::vector<cv::Point> > contours;
cv::findContours( test, contours, CV_RETR_EXTERNAL,CV_CHAIN_APPROX_NONE );
};

I've searched the internet and found a couple of similar posts like this, without any solution.

My post @ opencv.org : http://answers.opencv.org/question/12887/opencvfindcontour-crashes-v244-ms-visual-studio/ Where the image is visible right before the findContour is called.

Ive tried to solve this now for a couple of days, without any luck. So I really hope that someone here can help me fix this problem.

edit: When clicking on continue on the breakpoint window, this message comes up:

Unhandled exception at 0x770540f2 in eyeTracking.exe: 0xC0000374: A heap is damaged.

Thanks!

4

2 回答 2

5

您可能需要检查您使用的 DLL。将调试与发布 dll 混合也会导致问题。

于 2013-05-07T16:11:01.570 回答
0

问题是我链接到了错误的 opencv 库。我在调试期间使用了一些发布库。更改为调试库使一切正常。

于 2013-05-06T08:43:03.500 回答