I am using opencv 2.3.1 on Debian. The following code fails to load a given jpeg 2000 file.
#include "opencv/cv.h"
#include "opencv/highgui.h"
#include <vector>
#include <iostream>
int main()
{
IplImage* img_temp = cvLoadImage("delmeg.jp2", CV_LOAD_IMAGE_ANYCOLOR);
//IplImage* img_temp = cvLoadImage("delmec.jp2");
if(img_temp == NULL)
{
std::cout << "Can't load the image.." << std::endl;
return -1;
}
cv::Mat img(img_temp);
if (img_temp != NULL){
cvReleaseImage(&img_temp);
}
return 0;
}
I used the following command to compile it:
g++ -Wall -g -I /usr/include/ testopencv2x.cpp -o testopencv2x -lopencv_core -lopencv_imgproc -lopencv_highgui
Anybody know what I am missing here?
Thanks.