• opencv 3.2 vs2015 debug assertion __acrt_first_block == header


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

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

    报错:

    Microsoft Visual C++ Runtime Library
    ---------------------------
    Debug Assertion Failed!
     
    Program: ...workspaceFileConverterFileHandlerx64DebugFileHandler.exe
    File: minkernelcrtsucrtsrcappcrtheapdebug_heap.cpp
    Line: 980
     
    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[3];.
    
    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];.
    问题解决
  • 相关阅读:
    ActiveMQ中JMS的可靠性机制
    ActiveMQ中Broker的应用与启动方式
    ActiveMQ支持的传输协议
    ActiveMQ常见消息类型
    Oracle体系结构及备份(十六)——bg-ckpt
    PHP自学之路---雇员管理系统(1)
    UVa11187
    给Android组件添加事件一个很好用的方法
    【项目那些事儿】项目哪些事儿?
    struts2对拦截器使用带实例
  • 原文地址:https://www.cnblogs.com/zuochanzi/p/7272088.html
Copyright © 2020-2023  润新知