I'm trying to load a .pbm image with opencv.
I'm using the imread function; the documentation says that it should open pbm files but I can't make it work.
It does work with other format like png/jpeg/...
#define CV_LOAD_IMAGE_ANYDEPTH 2
#define CV_LOAD_IMAGE_ANYCOLOR 4
[...]
//argv[1] is the file's name
cv::Mat img = cv::imread(argv[1], CV_LOAD_IMAGE_ANYDEPTH | CV_LOAD_IMAGE_ANYCOLOR);
if (img.rows*img.cols==0){
printf("\nImage not loaded");
return 0;
}
..of course, with pbm files, it returns 0.