OpenCV 2.4.9 on linux can not read jpeg image
Please help me how to read a jpeg image. I have no problem reading the images in tif format. I used the example OpenCV-2.4.9/sources/samples/cpp/image.cpp for testing.
Thanks Stan
Media I/O: ZLib: build (ver 1.2.7) JPEG: libjpeg (ver 62) PNG: build (ver 1.5.12) TIFF: build (ver 42 - 4.0.2) JPEG 2000: build (ver 1.900.1) OpenEXR: build (ver 1.7.1)
try {
Mat img = imread(fname);
if(img.empty())
{
fprintf(stderr, "Can not load image %s\n", fname);
return -1;
}
}
catch(cv::Exception& e )
{
fprintf(stderr, "Error: %s\n", e.what());
return -2;
}
message: Can not load image: lena.jpg. Program works well for lena.png, lena.tif, lena.bmp
What is your error message?
The program returns no error.
Could you check that the JPEG image is in appropriate directory? You are not getting an exception which could imply that your code was unable to find the image.
haha no solution. I already did. Thanks unxnut