演示:读入一张图片,并显示

 

  1. #include "stdafx.h"  
  2. #include <opencv2/core/core.hpp>  
  3. #include <opencv2/contrib/contrib.hpp>  
  4. #include <opencv2/highgui/highgui.hpp>  
  5. #include <opencv2/imgproc/imgproc.hpp>  
  6. #include <opencv2/objdetect/objdetect.hpp>  
  7.     
  8. using namespace cv;  
  9. using namespace std;  
  10. #pragma comment(linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"")   
  11. int main(int argc, char** argv[])  
  12. {  
  13.     //加载图像文件 
  14.     IplImage* img = cvLoadImage("F:\\life\\大悲集\\580360_4.jpg");  
  15.     
  16.     //显示窗口
  17.     cvNamedWindow("Pusa", CV_WINDOW_AUTOSIZE);  
  18.     
  19.     //显示图像
  20.     cvShowImage("Pusa", img);  
  21.     
  22.     //等待任意键
  23.     cvWaitKey(0);  
  24.     
  25.     //释放图像
  26.     cvReleaseImage(&img);  
  27.     //销毁窗口
  28.     cvDestroyWindow("Pusa");  
  29.     
  30.     return 0;  
  31. }  

 

Open CV 图像显示(1)

相关文章:

  • 2021-09-07
  • 2021-11-29
  • 2021-10-13
  • 2021-08-13
  • 2021-10-11
  • 2021-07-22
  • 2022-12-23
猜你喜欢
  • 2021-08-06
  • 2021-07-08
  • 2021-09-18
  • 2021-06-04
  • 2021-07-02
  • 2021-06-05
  • 2022-12-23
相关资源
相似解决方案