Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

libpng issues ?

I am trying to open up png files on my XCode 4.4 (Mountain Lion) with the following codes (works for jpg files)

Mat image = imread( "/Users/user_name/Desktop/result.png" );
imshow( "", image );
waitKey( 0 );

But OpenCV throws me this error:

libpng warning: Application built with libpng-1.4.12 but running with 1.5.4
OpenCV Error: Bad flag (parameter or structure field) (Unrecognized or unsupported array type) in cvGetMat, file /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_opencv/opencv/work/OpenCV-2.4.2/modules/core/src/array.cpp, line 2482
libc++abi.dylib: terminate called throwing an exception

Seems like my png file was created using a newer libpng, while OpenCV is using older one. So how do I resolve this issue ?

libpng issues ?

I am trying to open up png files on my XCode 4.4 (Mountain Lion) with the following codes (works for jpg files)

Mat image = imread( "/Users/user_name/Desktop/result.png" );
imshow( "", image );
waitKey( 0 );

But OpenCV throws me this error:

libpng warning: Application built with libpng-1.4.12 but running with 1.5.4
OpenCV Error: Bad flag (parameter or structure field) (Unrecognized or unsupported array type) in cvGetMat, file /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_opencv/opencv/work/OpenCV-2.4.2/modules/core/src/array.cpp, line 2482
libc++abi.dylib: terminate called throwing an exception

Seems like my png file was created using a newer libpng, while OpenCV is using older one. So how do I resolve this issue ?

Edit: more information

I'm using OSX Mountain Lion, with XCode 4.4, and using OpenCV 2.4.2 installed by using MacPorts