【发布时间】:2016-01-13 06:59:30
【问题描述】:
我是使用 Visual Studio 和 openCv 编程的新手。我写了一个简单的程序来显示图像的红色通道,但是每次我运行代码时都会抛出“DEBUG ASSERTION FAILED”错误。
#include <opencv2\imgproc\imgproc.hpp>
#include <opencv2\highgui\highgui.hpp>
#include <iostream>
using namespace std;
using namespace cv;
int main() {
Mat image;
image = imread("C:/Users/siddartha/Pictures/sample.jpg");
if (!image.data) {
cout << "Cannot load image";
return -1;
}
else {
if (image.channels() >= 3) {
vector<Mat> rgb;
split(image, rgb);
namedWindow("r");
imshow("r", rgb[0]);
}
}
while (1);
return 0;
}
错误:
Debug Assertion Failed!
Program: ...sual Studio 2015\Projects\sampleOpenCV\Debug\sampleOpenCV.exe
File: minkernel\crts\ucrt\src\appcrt\heap\debug_heap.cpp
Line: 892
Expression: is_block_type_valid(header->_block_use)
【问题讨论】:
标签: c++ opencv visual-studio-2015 visual-studio-debugging