I tried to understand why the following code gives me a bad pointer to the string "filename":
Mat imread(const string& filename, int flags) {
}
int main() {
string s = "test.jpg";
imread(s, 0);
}
I debugged step by step, and all I had was that before the input the imreadline was fine (I could check every element of it), but then it was impossible to do, and the debugger blamed Bad Ptr. I'm not sure I understand why this is happening.
Just so you know, I'm using Visual Studio 2008 and OpenCV 2.2.
EDIT: I really forgot to say one important thing that was essential for me to solve this problem: I wrote this code in a .cu file, so nvcc was compiled in the first instance.
Renan source
share