网上复制了一个转直方图的代码 ,说来也奇怪, 用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. Hibernate 再接触 一对多单向关联

    在1的方向加多的集合 Group.java package com.bjsxt.hibernate; import java.util.HashSet; import java.util.Set; i ...

  2. mysql 远程 ip访问

    默认情况下Linux内的mysql数据库mysql,user表内的用户权限只是对localhost即本机才能登陆.需要更改权限: 如下的方式确认: root#mysql -h localhost-u  ...

  3. eclipse git 冲突管理

  4. 简单的实现微信获取openid

    微信公众平台获取openid在公众号的开发中有很多用途,前段时间为实现用户使用公众号在登录一次以后可以免密登陆而使用了openid.开发过程中遇到了一些问题,在这里向需要且还没有获取到openid的米 ...

  5. kali装virtualbox

    系统换成了kali,因为有一些windows上的软件需要使用,于是在kali上安装virtualbox虚拟机,爬了不少坑费了不少劲终于安装好了. 1.首先下载virtualbox:https://ww ...

  6. PHPActiveRecord 学习三

    #事务处理 注意事务 数据库要用InnoDB引擎 $c1 = User::connection(); try { //开启事务 $c1->transaction(); //sql语句 $sql ...

  7. GreenDao在列中的单词之间自动加_

    1.第一种情况,原字段(属性.列)是 驼峰式命名法 @Entitypublic class Employee { @Id(autoincrement = true) private Long id; ...

  8. 对象转化为json

    google开发的Gson转换利器,String json = new Gson ().toJson(object); 一行代搞定. 别忘了引入jar包 转自:https://zhidao.baidu ...

  9. leetcode 中等题(1)

    2. Add Two Numbers(中等) /** * Definition for singly-linked list. * struct ListNode { * int val; * Lis ...

  10. linux命令之----sort命令用于将文本文件内容加以排序

    1.sort命令作用 sort命令用于将文本文件内容加以排序,将输入行按照键值字段与数据类型选项以及locale排序. 一个可预期的记录次序,会让用户的查看使用更方便:书的索引.字典.目录以及电话簿等 ...