opencv c++ 乱码

来源:互联网 发布:linux内核书籍推荐 编辑:程序博客网 时间:2024/05/16 11:20

无论选择 unicode 还是 Use Multi-Byte Character Set

 debug 版本,显示图片的窗口的标题总是不正确

而release 版本则正确。何解?

 

 

#include <iostream>#include <string>
#include <opencv/cv.h>#include <opencv2/highgui/highgui.hpp>using namespace cv;int main(int argc,char *argv){VideoCapture vido(0);if(!vido.isOpened()){std::cout<<"Can not open camera!"<<std::endl;}Mat frame;string wn("show");std::cout<<wn<<std::endl;while(vido.isOpened()){ vido>>frame;imshow(wn,frame);//显示if(cvWaitKey(30)==27){return 0;}}return 0;}


debug 版本设置《Use Unicode Character Set》,和显示结果

运行结果

 

debug 版本设置《Use Multi-Byte Character Set》,和显示结果

 

 

运行结果:

 

 

release 版本则 Multi-Byte Character 或者 unicode 都正确

结果如下图

 

 

原创粉丝点击