在Windows Server 2012 R2中使用OpenCV的Canny函数时C ++崩溃 [英] C++ crash when using OpenCV's Canny function in Windows Server 2012 R2

查看:558
本文介绍了在Windows Server 2012 R2中使用OpenCV的Canny函数时C ++崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

带有Update3的Visual Studio 2015. 使用OpenCV 3.4.3(x64)构建x64.

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

这是非常奇怪的错误.

在Windows7中运行此应用时,可以.但是在Windows Server 2012 R2中,无法正常工作. 应用程序崩溃而死了.

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.

无法访问文件'C:\ Windows \ System32 \ vcruntime140.dll'

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

但是文件在那里,并且我还安装了所有VC ++运行时重新分发程序包(2005、2008、2010、2012、2013、2015)x86和x64.

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.

更多,这是最好的固定东西. 当我评论cv :: Canny和应用程序就可以了! (当然,我在imshow行下面更改为imshow("window",frame);)

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.

由于某些原因,我无法在Server 2012 R2中使用VS2015对其进行调试

推荐答案

问题已解决.

服务器CPU是Intel Xeon Gold 6126.

The server CPU is Intel Xeon Gold 6126.

我认为OpenCV 3.4.3有一个错误.

I think OpenCV 3.4.3 has a bug about it.

OpenCV 3.4.5很好用.

OpenCV 3.4.5 works great.

这篇关于在Windows Server 2012 R2中使用OpenCV的Canny函数时C ++崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆