使用opencv不能在qt中获得输出?

使用opencv不能在qt中获得输出?,qt,opencv,ubuntu,Qt,Opencv,Ubuntu,我在ubuntu中编译以下使用qt和opencv的简单显示图像程序时,得到了空终端窗口的输出 代码 #包括 #包括 int main() { cv::Mat image=cv::imread(“img.jpg”); 简历:namedWindow(“我的形象”); 简历::imshow(“我的图像”,图像); cv::waitKey(5000); 返回1; } 给我答案 谢谢 dhanash您的cv::imread需要一个其他参数,您的核心标题在哪里??试试这个 #include <o

我在ubuntu中编译以下使用qt和opencv的简单显示图像程序时,得到了空终端窗口的输出

代码

#包括
#包括
int main()
{
cv::Mat image=cv::imread(“img.jpg”);
简历:namedWindow(“我的形象”);
简历::imshow(“我的图像”,图像);
cv::waitKey(5000);
返回1;
}
给我答案

谢谢


dhanash

您的
cv::imread
需要一个其他参数,您的核心标题在哪里??试试这个

  #include <opencv2/imgproc/core.hpp>
#include <opencv2/highgui/highgui.hpp>

int main()

{

cv::Mat image= cv::imread("img.jpg",1);
 cv::imshow("My Image", image);
cv::waitKey(0);
return 0;
}
#包括
#包括
int main()
{
cv::Mat image=cv::imread(“img.jpg”,1);
简历::imshow(“我的图像”,图像);
cv::waitKey(0);
返回0;
}

我在这里看不到什么东西?
  #include <opencv2/imgproc/core.hpp>
#include <opencv2/highgui/highgui.hpp>

int main()

{

cv::Mat image= cv::imread("img.jpg",1);
 cv::imshow("My Image", image);
cv::waitKey(0);
return 0;
}