Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

asked 2013-03-13 05:12:39 -0600

berak gravatar image

can't imread or imwrite in python

my first go at the python api (on win, 2.4.9), built cv2.pyd, but i can't imread ( result always None) or imwrite ( "could not find a writer for the specified extension" )

checked the pyd with dependancy walker, it's using the same dlls as my c++ code does (no problem there, png, jpg support built in ) other stuff in python seems to work well, e.g opening a videocapture / imshow

can't imread or imwrite in python

my first go at the python api (on win, 2.4.9), built cv2.pyd, but i can't imread ( result always None) or imwrite ( "could not find a writer for the specified extension" )

checked the pyd with dependancy walker, it's using the same dlls as my c++ code does (no problem there, png, jpg support built in ) other stuff in python seems to work well, e.g opening a videocapture / imshow

Edit: oh, fun, it turns out all strings i pass into the opencv api come out empty.

indeed, imwrite can't find a writer for 'empty string', but why doesn't it tell me ?

and why does it happen in the first place ?

using VS2008 here, python2.7.3 suspecting strange string settings, unicode woes, python compiled against a different runtime, hell, that's the stuff i hate most ;(

can't imread or imwrite in python

my first go at the python api (on win, 2.4.9), built cv2.pyd, but i can't imread ( result always None) or imwrite ( "could not find a writer for the specified extension" )

checked the pyd with dependancy walker, it's using the same dlls as my c++ code does (no problem there, png, jpg support built in ) other stuff in python seems to work well, e.g opening a videocapture / imshow

Edit: oh, fun, it turns out all strings i pass into the opencv api come out empty.

indeed, imwrite can't find a writer for 'empty string', but why doesn't it tell me ?

and why does it happen in the first place ?

using VS2008 here, python2.7.3 python2.7.1 suspecting strange string settings, unicode woes, python compiled against a different runtime, hell, that's the stuff i hate most ;(

can't imread or imwrite in python

my first go at the python api (on win, 2.4.9), built cv2.pyd, but i can't imread ( result always None) or imwrite ( "could not find a writer for the specified extension" )

checked the pyd with dependancy walker, it's using the same dlls as my c++ code does (no problem there, png, jpg support built in ) other stuff in python seems to work well, e.g opening a videocapture / imshow

Edit: oh, fun, it turns out all strings i pass into the opencv api come out empty.

indeed, imwrite can't find a writer for 'empty string', but why doesn't it tell me ?

and why does it happen in the first place ?

using VS2008 here, python2.7.1 suspecting strange string settings, unicode woes, python compiled against a different runtime, hell, that's the stuff i hate most ;(

Edit: Problem solved ( finally ...)

had to choose /D "UNICODE" ( unicode support in the general settings )

most of the std::strings in opencv have been replaced with cv::Strings, i guess they only work with unicode ( when combined with python )