RSS

Display Image using OpenCV

31 Jan

You may chage the image path.

#include "stdafx.h"
#include<opencv\cv.h>
#include<opencv\cxcore.h>
#include<opencv\highgui.h>

int _tmain(int argc, _TCHAR* argv[])
{
IplImage *img = cvLoadImage("C:\\opencv3\\img\\opencv.png",1);
cvNamedWindow("Image:",1);//Create new window
cvShowImage("Image:",img);//Display image in the window
cvWaitKey(0);//Wait until user press any key
cvDestroyWindow("Image:");//Destroy the window named 'Image'
cvReleaseImage(&img);//Release memory used for the image
return 0;
}
Advertisements
 
Leave a comment

Posted by on January 31, 2013 in C

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: