Program:
#include < cv.h >
#include
using namespace std;
int main(int argc, char** argv)
{
if(argc < 1 || argv[1] ==NULL)
{
return -1;
}
//Function which loads the image into an IplImage object
IplImage* img = cvLoadImage(argv[1]);
//Creates a window object to hold the image
cvNamedWindow("My Picture");
//show the image
cvShowImage("My Picture",img);
//Wait for some key to be pressed indefinitely
while(1)
{
char c = cvWaitKey();
//if escape character is pressed, break out of the loop
if( c == 27 ) break;
}
//Release IplImage object
cvReleaseImage( &img );
cvDestroyWindow("My Picture");
return(EXIT_SUCCESS);
}
Output:
No comments:
Post a Comment
Give ur thoughts!