Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

where should I put my image ?

Here is the code to show the image :

include "highgui.h"

include <iostream>

include <cv.h>

using namespace std; int main(int argc,char* argv) { char filename[]="0.jpg"; IplImage img = cvLoadImage(filename,CV_LOAD_IMAGE_UNCHANGED); if(!img){ cout<<"Error: Couldn't open the image file.\n"; } cvNamedWindow("Example1",CV_WINDOW_AUTOSIZE); cvShowImage("Example1",img); cvvWaitKey(0); cvReleaseImage(&img); cvDestroyWindow("Example1"); }

char filename[]="0.jpg"; How can it load an image without telling it the direct path of the image? or should I put my image in a default path?

where should I put my image ?

Here is the code to show the image :

include "highgui.h"

include <iostream>

include <cv.h>

using namespace std; std;

int main(int argc,char* argv) { char filename[]="0.jpg"; IplImage img = cvLoadImage(filename,CV_LOAD_IMAGE_UNCHANGED); if(!img){ cout<<"Error: Couldn't open the image file.\n"; } cvNamedWindow("Example1",CV_WINDOW_AUTOSIZE); cvShowImage("Example1",img); cvvWaitKey(0); cvReleaseImage(&img); cvDestroyWindow("Example1"); }

char filename[]="0.jpg"; How can it load an image without telling it the direct path of the image? or should I put my image in a default path?

click to hide/show revision 3
No.3 Revision

where should I put my image ?

Here is the code to show the image :

include "highgui.h"

#include "highgui.h"
#include <iostream>
#include <cv.h>
  

include <iostream>

include <cv.h>

using namespace std;

std;

int main(int argc,char* argc,char** argv) { char filename[]="0.jpg"; IplImage IplImage* img = cvLoadImage(filename,CV_LOAD_IMAGE_UNCHANGED); if(!img){ cout<<"Error: Couldn't open the image file.\n"; } cvNamedWindow("Example1",CV_WINDOW_AUTOSIZE); cvShowImage("Example1",img); cvvWaitKey(0); cvReleaseImage(&img); cvDestroyWindow("Example1"); }

}

>>> char filename[]="0.jpg";

How can it load an image without telling it the direct path of the image? or should I put my image in a default path?