网上复制了一个转直方图的代码 ,说来也奇怪, 用imshow 显示 图片在独立窗体内,不存在问题, 要注释掉这段代码就出现了下边的错误. 网上查了查,原来是程序中 有个std::vector<cv::Mat> ColorChannels;写法出了问题

//char OUTPUT_T[] = "histogram demo";
//imshow(OUTPUT_T, histImage);

报错:

Microsoft Visual C++ Runtime Library
---------------------------
Debug Assertion Failed! Program: ...workspace\FileConverter\FileHandler\x64\Debug\FileHandler.exe
File: minkernel\crts\ucrt\src\appcrt\heap\debug_heap.cpp
Line: Expression: __acrt_first_block == header For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts. (Press Retry to debug the application) ---------------------------
中止(A) 重试(R) 忽略(I)
---------------------------

问题原因有人说:使用DLL的时候,问题可能在于不同的堆用于分配和释放 引起的。

网上找到一段英文按照他说的改了,没问题了

The following code does not give the assertion, I simply changed std::vector<cv::Mat> ColorChannels; to cv::Mat ColorChannels[];.

I think that my solution is quick and dirty and maybe the solution offered by iedoc is better (I did not test it).

把上边的

 std::vector<cv::Mat> ColorChannels;换成 cv::Mat ColorChannels[3];.
问题解决

opencv 3.2 vs2015 debug assertion __acrt_first_block == header的更多相关文章

  1. C++析构函数造成Debug Assertion Failed的问题

    昨天写了两个程序,均出现了析构函数造成Debug Assertion Failed的问题,由于是初学c++怎么想也想不通问题出在哪里.今天早上经人指点终于明白问题所在了.下面贴出代码和问题解析:(以下 ...

  2. Expression: __acrt_first_block == header

    File: minkernel\crts\ucrt\src\appcrt\heap\debug_heap.cpp Line: 996 Expression: __acrt_first_block == ...

  3. Qt 调试时的错误——Debug Assertion Failed!

    在VS2008中写qt程序时调试出现此问题,但在release模式下就不存在,在网上搜罗了一圈,是指针的问题. 问题是这样的: 需要打开两个文件,文件中数据类型是float,我使用QVector进行保 ...

  4. Solve Error Debug Assertion Failed Expression vector iterators incompatible Using PCL in Release Mode of VS2010

    When using PCL 1.4.0 in the release mode building under VS2010, we might sometime get the error &quo ...

  5. imread() not working in OpenCV 2.4.11 Debug mode

    The OpenCV function imread() not working in OpenCV 2.4.11 Debug mode of VS2010 under Win32, the way ...

  6. Debug Assertion Failed!

    问题并没有解决..... 不知道怎么回事,先都没有这样的情况... VC++调程序出现如下错误: Debug   Assertion   Failed!       Program:   D:wyuS ...

  7. (转)Debug Assertion Failed! Expression: _pFirstBlock == pHead

      最近在VS上开发C++程序时遇到了这个错误: Debug Assertion Failed! Expression:_pFirstBlock == pHead 如图: 点击Abort之后,查看调用 ...

  8. C++ error:Debug Assertion Failed.Expression:_BLOCK_TYPE_IS_VALID(phead->nBlock)

    Debug Assertion Failed.Expression:_BLOCK_TYPE_IS_VALID(phead->nBlockUse) 关于上面这个错误,我在上一篇文章中的程序遇到过了 ...

  9. “Debug Assertion” Runtime Error on VS2008 VS2010 winhand.cpp

    I'm writing a C++ MFC program on VS2008 and I'm getting this "Debug Assertion Error" when ...

随机推荐

  1. 一秒去除Win7快捷方式箭头

    我相信有无数的小盆友跟我一样很讨厌Win7快捷方式图标上的箭头,实在太丑陋了,尤其是带有强迫症滴.现在介绍去除箭头的方式. 1. 打开编辑器,将以下代码粘贴进去,然后保存为.bat后缀的文件,然后双击 ...

  2. 3.AOP入门1.md

    目录 1.定义 1.1基本概念 2. 1.定义 1.1基本概念 AOP:aspect object programing面向切面编程 aop编程的要点在于关注点和切入点 关注点:指的是代码中的重复部分 ...

  3. iOS中的MVC

      我们今天谈谈cocoa程序设计中的 模型-视图-控制器(MVC)范型.我们将从两大方面来讨论MVC: 什么是MVC? M.V.C之间的交流方式是什么样子的? 理解了MVC的概念,对cocoa程序开 ...

  4. mp4格式(转帖加修改) 转载

    下面的软件下载地址:http://download.csdn.net/source/2607382 ftyp: 这是一个筐,可以装mdat等其他Box. 例:00 00 00 14 66 74 79 ...

  5. Kubernetes 本地仓库

    1.Kubernetes本地私有仓库 Docker仓库主要用于存放Docker镜像,Docker仓库分为公共仓库和私有仓库,基于registry可以搭建本地私有仓库.使用私有仓库有如下优点: 1)节省 ...

  6. nvm 安装

    curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh | bash nvm install 8.9. ...

  7. jstl-日期格式化-jsp页面需引入fmt标签

    jsp页面需引入fmt标签: <taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"> ...

  8. Using Service Workers

    [Using Service Workers] 1.This is an experimental technology Because this technology's specification ...

  9. Python之 ---成员修饰符

    一:成员修饰符:分为共有成员和私有成员: 私有成员:__通过两个下滑线:无法直接访问,要访问只能间接访问: 如下我们定义了一个对象,里面有两个共有的成员变量,成员变量是共有的时候我们可以外部访问,如果 ...

  10. JMeter学习(三十一)non-gui模式运行(转载)

    转载自 http://www.cnblogs.com/yangxia-test 必须要了解的一些信息 既然是要通过non-gui模式运行,那么我们就不得不去了解下在non-gui模式下jmeter命令 ...