【发布时间】:2015-02-22 05:07:51
【问题描述】:
下面是一个非常简单的例子,使用 openCV 来显示一个 2D 矩阵。奇怪的是,图片标题无法正确显示。请问有什么建议吗?
#include "stdafx.h"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <string>
#include <iostream>
using namespace cv;
using namespace std;
int main( int argc, const char** argv )
{
Mat M(200, 200, CV_8UC3, Scalar(0, 0, 255));
string Something ("Some text");
namedWindow("Hello", CV_WINDOW_AUTOSIZE);// Create a window for display.
imshow(Something, M);
waitKey(0);
return 0;
}
【问题讨论】:
-
你得到的输出是什么?没有理由这不应该工作。