Process JPG and PNG formats with Opencv for iOS platform

asked 2015-09-27 14:27:06 -0500

AsparaJoe gravatar image

Hello, I need to read and process JPG and PNG images (in other words obtain the Mat representation) with the OpenCV iOS version. I can't use specific system API to do this (e.g. using UIImage with iOS), instead I needo to accomplish it just with std C++ and OpenCV API. I made many attempts with imread() function but the returning Mat data is always NULL. Instead with bmp images all works fine.

Googling around I found somebody having the same problem with JPG and PNG formats. In addition to this when I run:

cout << cv::getBuildInformation() << endl;

In the output I found a lot of information among which there was the following:

Media I/O: 
ZLib:                        build (ver 1.2.8)
JPEG:                        build (ver 90)
WEBP:                        NO
PNG:                         build (ver 1.5.12)
TIFF:                        NO
JPEG 2000:                   NO
OpenEXR:                     NO
GDAL:                        NO

I suppose it may refer to the issue I have mentioned above. Hope somebody can confirm and more important suggest me a way to process JPG, PNG images with just OpenCV API.


edit retag flag offensive close merge delete