我正在使用该程序来读取并显示图像。 我不知道为什么它显示这个奇怪的错误:未知函数中的声明失败
assertion failed
(scn==3 || scn ==4)
in unknown function,file......\src\modules\imgproc\src\color.cpp line 3326
我改变了一些图片,有时候它运行没有错误,但是,即使当它运行一切,它显示的窗口,但不是在它的形象。哪里不对?
#include "stdafx.h"
#include "opencv2/calib3d/calib3d.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
using namespace cv;
using namespace std;
void main()
{
Mat leftImg,frame=imread("C:\\Users\\user\\Downloads\\stereo_progress.png");
leftImg=imread("C:\\Users\\user\\Downloads\\dm_sl.gif");//add of left camera
cvtColor(leftImg,leftImg,CV_BGR2GRAY);
imwrite("imreadtest.txt",leftImg);
imshow("cskldnsl",leftImg);
getchar();
}
thnx barshan第二点做了伎俩..但是我很困惑,为什么getchar()应该导致这个问题。 –