-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathocvts.cpp
More file actions
executable file
·20 lines (18 loc) · 955 Bytes
/
Copy pathocvts.cpp
File metadata and controls
executable file
·20 lines (18 loc) · 955 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace cv;
int main( int argc, char** argv )
{
IplImage* pImg; //声明IplImage指针
if( argc == 2 && (pImg = cvLoadImage( argv[1], 1)) != 0 ) { //载入图像
cvNamedWindow( "Image", 1 ); //创建窗口
cvResizeWindow("Image", pImg->width, pImg->height);
cvShowImage( "Image", pImg ); //显示图像
cvWaitKey(0); //等待按键
cvDestroyWindow( "Image" ); //销毁窗口
cvReleaseImage( &pImg ); //释放图像
return 0;
}
return -1;
}