C++ crash when using OpenCV's Canny function in Windows Server 2012 R2

天涯浪子 提交于 2020-01-06 07:09:08

问题


while (true)
{
    cap.read(frame);

    if (frame.empty())
    {
        cap.release();
        break;
    }

    cv::cvtColor(frame, frame, CV_BGR2GRAY);
    cv::GaussianBlur(frame, frame, cv::Size(3, 3), 1.8);

    cv::Mat edgeImage;
    cv::Canny(frame, edgeImage, 120, 255, 5);

    imshow("window", edgeImage);
    cv::waitKey(15);
}

Visual Studio 2015 with Update3. Build it x64 with OpenCV 3.4.3(x64).

This is very strange error.

When run this app in Windows7, It's OK. But in Windows Server 2012 R2, Not working. App crash and dead.

After app crash, I found log in Event Viewer in Control Panel.

Can't access file 'C:\Windows\System32\vcruntime140.dll'

But the file is in there, and also I installed all of VC++ runtime redistribution package (2005,2008,2010,2012,2013,2015) x86 and x64 both.

More, Here is best stange things. When I comment cv::Canny and app works just fine! (of course I change below imshow line to imshow("window", frame);)

I don't know what happended to this application... Please give me any advice.

I can't debug it with VS2015 in Server 2012 R2 due to some reasons


回答1:


Problem solved.

The server CPU is Intel Xeon Gold 6126.

I think OpenCV 3.4.3 has a bug about it.

OpenCV 3.4.5 works great.



来源:https://stackoverflow.com/questions/54071839/c-crash-when-using-opencvs-canny-function-in-windows-server-2012-r2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!