Can't Decode Webp
I can open webp from file, but I can't get the following test code to decode the webp encoded format in memory on Python. I'd appreciate any pointer.
img = cv2.imread(file)
retval, buf = cv2.imencode(".webp", img, [cv2.IMWRITE_WEBP_QUALITY, 100])
img = cv2.imdecode(buf, 1)
imdecode_(''): can't read data: OpenCV(4.1.0) /io/opencv/modules/imgcodecs/src/grfmt_webp.cpp:164: error: (-215:Assertion failed) data.rows == 1 in function 'readData'
please check
cv2.getBuildInformation()
-- maybe your cv2 does not have any support for webp codecs builtin (look at theMedia I/O:
section !)I can open webp format from File though, so it's capable of decoding webp.
https://github.com/opencv/opencv/issu...
Hi all,I want to know how you can solve this problem.I also encountered this problem when calling opencv410 in Java
this is log: imdecode_(''): can't read data: OpenCV(4.1.0) /home/yuxiaoyang/repo_test/xmss_3rdparty/opencv-4.1.0-imsize/modules/imgcodecs/src/grfmt_webp.cpp:164: error: (-215:Assertion failed) data.rows == 1 in function 'readData' imdecode width=0 imdecode height=0