I'm running on Win XP using Eclipse CDT and MINGW with rebuilt libraries for OpenCV 2.3.1.
Using a small C++ test program below I get an error message when I set a breakpoint and run the program with the debugger: "Clear Breakpoints Status". java.lang.NullPointerException.
The code is:
#include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <iostream>
using namespace cv;
using namespace std;
void help(char* progName)
{
cout << endl
<< "This program demonstrated the use of the discrete Fourier transform (DFT). " << endl
<< "The dft of an image is taken and it's power spectrum is displayed." << endl
<< "Usage:" << endl
<< progName << " [image_name -- default lena.jpg] " << endl << endl;
}
int main(int argc, char ** argv)
{
help(argv[0]);
const char* filename = argc >=2 ? argv[1] : "./lena.jpg";
Mat I = imread(filename, CV_LOAD_IMAGE_GRAYSCALE);
if( I.empty())
{
cout<<endl<<"No file"<<endl;
return -1;
}
}
The breakpoint is at the first open brace of int main.
But if I remove everything after "const char* filename...", there is no problem.
So it starts as soon as the code line "Mat I=imread....." is included.
What am I missing? How do I fix this?
[Updated on: Tue, 24 January 2012 16:54]
Report message to a moderator