作者:gnuhpc
出处:http://www.cnblogs.com/gnuhpc/

 

/* 程序名:hello.c
功能:从磁盘中读入图像文件,并将图像显示在屏幕上
*/
#include "cv.h"
#include "highgui.h"
int main( int argc, char** argv )
{
IplImage* pImg; //声明IplImage指针
//载入图像
if( argc == 2 && (pImg = cvLoadImage( argv[1], 1)) != 0 )
{
cvNamedWindow( "Window1", CV_WINDOW_AUTOSIZE ); //创建窗口
cvShowImage( "Window1", pImg ); //显示图像
cvWaitKey(-1); //等待按键
cvDestroyWindow( "Window1" );//销毁窗口
cvReleaseImage( &pImg ); //释放图像
return 0;
}
return -1;
}

相关文章:

  • 2021-12-31
  • 2021-07-03
  • 2021-05-19
  • 2022-03-02
  • 2021-12-05
  • 2021-12-06
  • 2021-12-24
猜你喜欢
  • 2021-08-01
  • 2021-12-08
  • 2021-12-24
  • 2022-12-23
  • 2021-12-26
  • 2022-12-23
  • 2021-11-30
相关资源
相似解决方案