Wednesday, 9 January 2013

Program To load a image From Your Computer using OpenCV:

////////////////////////////////////  C LIBRARIES /////////////////

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");
 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.