Program To load a image From Your Computer using OpenCV:
//Image_load
#include<opencv\highgui.h>
//////////////////////////////////// C LIBRARIES /////////////////
#include<stdio.h>
///////////////////////////////////////////////////////////////
int main(int argc,char* argv){
IplImage* img; // declaring img in OpenCV
img = cvLoadImage("E:\\Image.JPG",1); /// loads the image from the location E: //
if(img == NULL){ //// If Image is not present then the program terminates
printf("Error: Frame is Null \n");
getchar();
return(-1);
}
cvNamedWindow("Original",CV_WINDOW_AUTOSIZE); // loads window with auto size
cvShowImage("original",img); //// shows the output image
cvWaitKey(0); // waits for the key stroke to destroy window.
cvDestroyWindow("Original");
return(0);
}
Output:
No comments:
Post a Comment