I use imread() function to read tif image, but the returned Mat is empty.
vector<Mat> imgs;
int num = 10;
for (int i = 1; i <= num; i++) {
char buffer_s[200];
sprintf(buffer_s, "img%02d.jpg",i);
Mat buffer_img = imread(buffer_s);
if (buffer_img.empty()) {
cout << buffer_s << " read incorrectly" << endl;
return -1;
}
imgs.push_back(buffer_img);
}
The images to be read are under the project directory. I also tried to use the absolute path but the outcome was the same. Here is the debug interface:
I can't figure it out.