Hi all, I'm working with OpenCV 2.4.3 in iOS. I want to read an image, so I use imread() function, but result Mat image is always empty.
NSString *nsFileName = [destPath stringByAppendingPathComponent:imgSVMList[i]];
std::string fileName = std::string([nsFileName UTF8String]);
img = imread(fileName,CV_LOAD_IMAGE_GRAYSCALE);
if (!img.data) {
NSLog(@"Errore nella lettura dell'immagine");
} else {
NSLog(@"Rows: %i; Cols: %i",img.rows,img.cols);
}
destPath is a Documets subfolder (/Documents/ImgSVM/) and imgSVMLista[] is a vector with images filename. So, nsFileName is, for example, <...>/Documents/ImgSVM/Img1.jpg. Well, img is alway empty.
As you can see rows and cols are 0. This is an example of image I want to read:
Any suggestion? Costantino