<pre name="code" class="cpp">把任意大小的一幅JPG图像命名为"first.jpg",放入工程文件夹目录下。
</pre><pre name="code" class="cpp">#include<highgui.h>
using namespace std;
char *FileName="first.jpg";
int main()
{
IplImage* img = cvLoadImage( FileName );
cvNamedWindow( "Example1", CV_WINDOW_AUTOSIZE );
cvShowImage("Example1", img);
cvWaitKey(0);
cvReleaseImage( &img );
cvDestroyWindow( "Example1" );
return 0;
}
</pre><pre name="code" class="cpp">结果:
</pre><img src="https://img-blog.csdn.net/20160118220918050" alt="" /><pre>
<pre name="code" class="cpp">把任意大小的一幅JPG图像命名为"first.jpg",放入工程文件夹目录下。
</pre><pre name="code" class="cpp">#include<highgui.h>
using namespace std;
char *FileName="first.jpg";
int main()
{
IplImage* img = cvLoadImage( FileName );
cvNamedWindow( "Example1", CV_WINDOW_AUTOSIZE );
cvShowImage("Example1", img);
cvWaitKey(0);
cvReleaseImage( &img );
cvDestroyWindow( "Example1" );
return 0;
}
</pre><pre name="code" class="cpp">结果:
</pre><img src="https://img-blog.csdn.net/20160118220918050" alt="" /><pre>